Trevixal API
    Preparing search index...

    Interface ToolbarOptions

    interface ToolbarOptions {
        ariaLabel?: string;
        blockCommands?: BlockCommands;
        blockFormats?: readonly SelectOption[];
        codeFormatCommands?: CodeFormatCommands;
        extraItems?: Readonly<
            Record<string, readonly (ToolbarItem | ToolbarControl)[]>,
        >;
        fontFamilies?: readonly SelectOption[];
        fontSizes?: readonly SelectOption[];
        formatPainterState?: () => FormatPainterState;
        groupNames?: readonly string[];
        groupOrder?: readonly string[];
        groups?: readonly ToolbarGroup[];
        items?: readonly (ToolbarItem | ToolbarControl)[];
        letterSpacings?: readonly SelectOption[];
        lineHeights?: readonly SelectOption[];
        messages?: Readonly<Record<string, string>>;
        onCommandPalette?: (editor: Editor) => void;
        onCopyCode?: (editor: Editor) => void;
        onEmoji?: (editor: Editor) => void;
        onFindReplace?: (editor: Editor) => void;
        onFormatPainter?: (editor: Editor, event: MouseEvent) => void;
        onImage?: (editor: Editor) => void;
        onInsertTable?: (editor: Editor, rows: number, cols: number) => void;
        onLink?: (editor: Editor) => void;
        onReorder?: (order: readonly string[]) => void;
        onSpecialCharacter?: (editor: Editor) => void;
        onToggleFocusMode?: (editor: Editor) => void;
        onToggleFullscreen?: (editor: Editor) => void;
        onToggleOutline?: (editor: Editor) => void;
        onToggleTableOfContents?: (editor: Editor) => void;
        onWordCount?: (editor: Editor) => void;
        paragraphSpacings?: readonly SelectOption[];
        reorderable?: boolean;
    }
    Index
    ariaLabel?: string
    blockCommands?: BlockCommands

    Advanced-block commands, supplied by the host so this package does not depend on @trevixal/extension-blocks. Pass blockUICommands() from that package. The blocks group is skipped when this is absent.

    blockFormats?: readonly SelectOption[]

    Block formats offered by the format select.

    codeFormatCommands?: CodeFormatCommands

    JSON/XML formatting, from @trevixal/extension-format-code. The matching buttons are skipped when absent.

    extraItems?: Readonly<Record<string, readonly (ToolbarItem | ToolbarControl)[]>>
    fontFamilies?: readonly SelectOption[]
    fontSizes?: readonly SelectOption[]
    formatPainterState?: () => FormatPainterState

    Current painter state, for the button's appearance and tooltip. Armed state lives in the painter rather than the document, so the toolbar cannot read it from a snapshot.

    groupNames?: readonly string[]

    Group names to render, in this order. Omit for every group. Lets a host pick categories, groupNames: ['marks', 'lists'] for a compact bar.

    groupOrder?: readonly string[]

    The order to show the groups in, by name, typically what onReorder last reported. Unlike groupNames it hides nothing: groups it does not mention follow in their default order, and names that match no group are ignored, so a remembered order survives a group being added or removed.

    groups?: readonly ToolbarGroup[]
    items?: readonly (ToolbarItem | ToolbarControl)[]

    Flat item list (legacy shape) or grouped rows.

    letterSpacings?: readonly SelectOption[]
    lineHeights?: readonly SelectOption[]
    messages?: Readonly<Record<string, string>>

    Translations, keyed toolbar.<item name> and toolbar.group.<name>, with .aria for an accessible name that differs from the label. Anything missing keeps its English; see defaultMessages.

    onCommandPalette?: (editor: Editor) => void

    Opens the command palette.

    onCopyCode?: (editor: Editor) => void

    Copy the code block at the selection; from the code-highlight package.

    onEmoji?: (editor: Editor) => void

    Opens an emoji picker.

    onFindReplace?: (editor: Editor) => void

    Opens the find-and-replace bar.

    onFormatPainter?: (editor: Editor, event: MouseEvent) => void

    Arms the format painter; supplied by a host holding a FormatPainter.

    onImage?: (editor: Editor) => void

    Called by the image button; supply a picker or dialog.

    onInsertTable?: (editor: Editor, rows: number, cols: number) => void

    Called by the table grid with the chosen dimensions.

    onLink?: (editor: Editor) => void

    Called by the link button; supply a dialog.

    onReorder?: (order: readonly string[]) => void

    Called with the new group order whenever the user rearranges the bar.

    onSpecialCharacter?: (editor: Editor) => void

    Opens a special-character picker.

    onToggleFocusMode?: (editor: Editor) => void

    Toggles focus mode.

    onToggleFullscreen?: (editor: Editor) => void

    Toggles fullscreen.

    onToggleOutline?: (editor: Editor) => void

    Toggles the document-outline panel.

    onToggleTableOfContents?: (editor: Editor) => void

    Toggles the table-of-contents panel.

    onWordCount?: (editor: Editor) => void

    Shows the word-count readout.

    paragraphSpacings?: readonly SelectOption[]
    reorderable?: boolean

    Give every group a grip that drags it to a new place in the bar, the Office toolbar convention. From the keyboard, Space on the grip picks the group up and the arrow keys move it. Each new order is reported through onReorder.