Skip to content
API reference

blocks/command-menu

Import
import * as api from "@fungi.computer/caps/blocks/command-menu";
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”
Signature
type CommandMenuItem = object;

Caller-provided command menu item data.

Signature
optional description?: string;
Signature
optional disabled?: boolean;
Signature
id: string;
Signature
label: string;
Signature
optional shortcut?: string;

Key hint shown before the label, e.g. z in a which-key list.

Signature
optional media?: ReactNode;

Decorative leading visual, such as a thumbnail, shown before the label.


CommandMenuPropstype alias

Section titled “CommandMenuProps”
Signature
type CommandMenuProps = Omit<
HTMLAttributes<HTMLUListElement>,
"children" | "onSelect"
> &
object;

Props accepted by CommandMenu.

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”
Signature
const CommandMenu: ForwardRefExoticComponent<
Omit<HTMLAttributes<HTMLUListElement>, "children" | "onSelect"> &
object &
RefAttributes<HTMLUListElement>
>;

A single-focus listbox with local navigation and caller-owned selection.