sesaparcours
    Preparing search index...

    Type Alias MenuItemCommand<T>

    type MenuItemCommand<T = unknown> = {
        ariaLabel?: DynamicValue<string>;
        checked?: DynamicValue<boolean | "mixed">;
        class?: string;
        data?: T;
        enabled?: DynamicValue<boolean>;
        id?: string;
        keyboardShortcut?: string;
        label?: DynamicValue<string>;
        onMenuSelect?: (
            _: { data?: T; id?: string; modifiers: KeyboardModifiers },
        ) => void;
        tooltip?: DynamicValue<string>;
        type?: "command";
        visible?: DynamicValue<boolean>;
    }

    Type Parameters

    • T = unknown
    Index

    Properties

    ariaLabel?: DynamicValue<string>

    An accessible text string that describes the item. Usually not necessary, as the label is used for this, however if the menu item is for example a color swatch, the ariaLabel can be used to describe the color.

    checked?: DynamicValue<boolean | "mixed">
    class?: string

    A CSS class applied to the item

    data?: T

    This data payload is passed to the onMenuSelect() hook and with the menu-select event

    enabled?: DynamicValue<boolean>
    id?: string

    This id string is passed to the onMenuSelect() hook and with the menu-select event

    keyboardShortcut?: string
    label?: DynamicValue<string>

    A string of HTML markup used to describe the item

    onMenuSelect?: (
        _: { data?: T; id?: string; modifiers: KeyboardModifiers },
    ) => void

    When this menu item is selected, a menu-select event is dispatched and this hook is called.

    tooltip?: DynamicValue<string>
    type?: "command"
    visible?: DynamicValue<boolean>