Type Alias MenuItemCommand<T>

MenuItemCommand<T>: {
    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

Type declaration

  • OptionalariaLabel?: 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.

  • Optionalchecked?: DynamicValue<boolean | "mixed">
  • Optionalclass?: string

    A CSS class applied to the item

  • Optionaldata?: T

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

  • Optionalenabled?: DynamicValue<boolean>
  • Optionalid?: string

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

  • OptionalkeyboardShortcut?: string
  • Optionallabel?: DynamicValue<string>

    A string of HTML markup used to describe the item

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

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

  • Optionaltooltip?: DynamicValue<string>
  • Optionaltype?: "command"
  • Optionalvisible?: DynamicValue<boolean>