blessed-components - v1.20.0
    Preparing search index...

    Interface DropdownMenuData<TAction>

    Stateful data accepted by Blessed dropdownMenu adapter.

    interface DropdownMenuData<TAction extends MenuItem = MenuItem> {
        activeItemId?: string;
        characters?: DropdownMenuCharacters;
        focusedId?: string;
        items: readonly DropdownMenuItem<TAction>[];
        onAction?: (menuId: string, item: TAction) => void;
        onActiveItemIdChange?: (itemId: string) => void;
        onFocusedIdChange?: (menuId: string) => void;
        onOpenIdChange?: (openId: string | undefined) => void;
        openId?: string;
        separator?: string;
        shortcutSeparator?: string;
    }

    Type Parameters

    Index

    Properties

    activeItemId?: string

    Preferred focused action id inside open menu.

    Character tokens used by pure renderer.

    focusedId?: string

    Preferred focused top-level menu id.

    items: readonly DropdownMenuItem<TAction>[]

    Ordered top-level menus. Disabled menus/actions are visible but skipped.

    onAction?: (menuId: string, item: TAction) => void

    Called when action activates.

    onActiveItemIdChange?: (itemId: string) => void

    Called after focused action changes.

    onFocusedIdChange?: (menuId: string) => void

    Called after focused top-level menu changes.

    onOpenIdChange?: (openId: string | undefined) => void

    Called when open menu changes.

    openId?: string

    Controlled open menu id.

    separator?: string

    Text inserted between top-level menus.

    shortcutSeparator?: string

    Text inserted between action label and shortcut.