Command menu
Overlays⌘K-style palette. Modal shell (focus-trapped), fuzzy substring filtering over labels+keywords, grouped results and full keyboard control. This site's own search runs on it.
import { CommandMenu } from "@componentforge/react";
Examples
Command palette
Type to filter across groups; arrows move, Enter runs.
Accessibility
- Input uses role="combobox" with aria-activedescendant pointing at role="option" items — DOM focus never leaves the input while navigating.
- Visible groups get accessible group labels; empty state is announced by the live list region.
- Autofocus lands on the input via [data-autofocus].
Keyboard interactions
| Key | Action |
|---|---|
| ↑ / ↓ | Move active item (wraps). |
| Home / End | First / last visible item. |
| Enter | Run item action and close. |
| Esc | Close the menu. |
API reference
Selected props — every component also spreads native HTML attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| Item.label | string | — | Filterable text; also fallback display. |
| Item.keywords | string | "" | Extra filter-only terms. |
| Item.shortcut | string | — | Rendered as a <kbd> chip. |
| Item.onSelect | () => void | — | Invoked after the menu closes. |