TX Sheet Control

RibbonOptions Interface

Interface

Initial ribbon presentation and item policies are passed as SpreadsheetOptions.ribbon. The same shape supplies partial runtime patches to ui.ribbon.configure.

Type-only browser declaration from @txtextcontrol/tx-sheet-control; it is not a runtime constructor.

Syntax

interface RibbonOptions {
    layout?: RibbonLayoutMode;
    displayMode?: RibbonDisplayMode;
    tabs?: Record<string, RibbonItemOptions>;
    groups?: Record<string, RibbonItemOptions>;
    buttons?: Record<string, RibbonItemOptions>;
}

Members

MemberDescription
layoutInitial command density, defaulting to classic. Omit from a patch to retain the current density.
displayModeInitial command display, defaulting to expanded. Tabs-only retains the chosen density.
tabsPolicies keyed by tab IDs such as reporting. A disabled tab cannot become active through contextual selection.
groupsPolicies keyed by scoped group IDs such as home.clipboard. False parent policies apply to descendants.
buttonsPolicies keyed by scoped control IDs such as home.font.bold. Controls include buttons, selectors and inputs.

Examples

Use a mounted editor to configure the commands available for editing a report.

import { Spreadsheet } from '@txtextcontrol/tx-sheet-control';

function configureEditor(host: HTMLElement) {
    const editor = new Spreadsheet(host, {
        license: 'YOUR_SIGNED_LICENSE',
        height: 600,
        fontCatalogURL: '/assets/sheet/fonts/catalog.json',
    });
    editor.ui.ribbon.configure({
        layout: 'compact',
        displayMode: 'expanded',
        tabs: { reporting: { enabled: false } },
        groups: { 'home.clipboard': { enabled: false } },
        buttons: { 'home.font.bold': { enabled: false } },
    });
    return editor;
}

Remarks

Settings belong to the editor, survive workbook loads and are excluded from workbook serialization. Item policies customize screen commands; they do not restrict workbook API calls or keyboard editing. Use worksheet protection for document editing rules.

See Also

Replace YOUR_SIGNED_LICENSE with your issued Trial, Developer or OEM token before running the editor example.