@samatawy/diagrams
    Preparing search index...

    Interface TopMenuItem

    Lightweight top menu that renders in the main menu bar or inside a dropdown menu.

    interface TopMenuItem {
        label: string;
        altKey: string;
        shortcut?: string[];
        icon?: string;
        hint?: string;
        toggle?: boolean;
        isActive?: (target?: unknown) => boolean;
        isEnabled?: (target?: unknown) => boolean;
        isVisible?: (target?: unknown) => boolean;
        onClick: (target?: unknown) => void;
        element?: HTMLElement;
    }
    Index

    Properties

    label: string

    The display label for the menu item.

    altKey: string

    The underlined keyboard shortcut for the menu item.

    shortcut?: string[]

    Optional keyboard shortcut for the menu item.

    icon?: string

    Optional icon for the menu item.

    hint?: string

    Optional tooltip for the menu item.

    toggle?: boolean

    Optional toggle state for the menu item.

    isActive?: (target?: unknown) => boolean

    Optional callback to determine whether the item is active. Required if toggle is true.

    isEnabled?: (target?: unknown) => boolean

    Optional callback to determine whether the item is enabled.

    isVisible?: (target?: unknown) => boolean

    Optional callback to determine whether the item is visible.

    onClick: (target?: unknown) => void

    Callback invoked when the item is clicked.

    element?: HTMLElement

    Reference to the menu item element, set only after the item is rendered.