API reference
blocks/command-menu
Import
Section titled “Import”import * as api from "@fungi.computer/caps/blocks/command-menu";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | CommandMenuItem | Caller-provided command menu item data. |
| type alias | CommandMenuProps | Props accepted by CommandMenu. |
| constant | CommandMenu | A single-focus listbox with local navigation and caller-owned selection. |
CommandMenuItemtype alias
Section titled “CommandMenuItem”type CommandMenuItem = object;Caller-provided command menu item data.
Properties
Section titled “Properties”description?
Section titled “description?”optional description?: string;disabled?
Section titled “disabled?”optional disabled?: boolean;id: string;label: string;shortcut?
Section titled “shortcut?”optional shortcut?: string;Key hint shown before the label, e.g. z in a which-key list.
media?
Section titled “media?”optional media?: ReactNode;Decorative leading visual, such as a thumbnail, shown before the label.
CommandMenuPropstype alias
Section titled “CommandMenuProps”type CommandMenuProps = Omit< HTMLAttributes<HTMLUListElement>, "children" | "onSelect"> & object;Props accepted by CommandMenu.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
items |
readonly CommandMenuItem[] |
- |
onSelect() |
(id) => void |
Called after a non-disabled item is selected. |
selected? |
string |
Caller-owned selected state; distinct from local keyboard focus. |
descriptionPlacement? |
"end" | "inline" |
end (default) sets each description at the row’s end. inline keeps the label at its own width and starts the description right after it, truncated, so long descriptions never push the row’s text apart. |
CommandMenuconstant
Section titled “CommandMenu”const CommandMenu: ForwardRefExoticComponent< Omit<HTMLAttributes<HTMLUListElement>, "children" | "onSelect"> & object & RefAttributes<HTMLUListElement>>;A single-focus listbox with local navigation and caller-owned selection.