CommandMenu

1 field over every action. Type, arrow, Enter.

Installation

Installs the Base UI flavor. Switch in the right panel.

Playground

Inspect
CalendarToday
New fileBlank document⌘N
SettingsAccount and workspace⌘,
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
Starred
RecentLast 7 days
Documentation
What's newRelease notes
Contact supportReply within a day
Select↑↓Run↵

Basic

Type to filter, press ↓ ↑ to move, Enter to run. Rows come from items, grouped by group.

Inspect
New file
Search everywhere
Toggle dark mode
Copy link
Invite people
Export as PDF
Home
Inbox
Calendar
Starred
Recent
Settings
Documentation
What's new
Contact support

Descriptions, shortcuts, disabled rows

3 more fields per row: description, shortcut caps, and disabled, which the arrows skip. Type clipboard: keywords match too.

Inspect
New fileBlank document⌘N
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
CalendarToday
Starred
RecentLast 7 days
SettingsAccount and workspace⌘,
Documentation
What's newRelease notes
Contact supportReply within a day

Suggestions

3 suggested rows lead until you type 1 letter, then the groups take over.

Inspect
CalendarToday
New fileBlank document⌘N
SettingsAccount and workspace⌘,
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
Starred
RecentLast 7 days
Documentation
What's newRelease notes
Contact supportReply within a day

Tabs

Click a tab or press ← →, then derive items from the value. Children hug the row's end: put CommandMenuFilters there to share the line.

Inspect
New fileBlank document⌘N
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
CalendarToday
Starred
RecentLast 7 days
SettingsAccount and workspace⌘,
Documentation
What's newRelease notes
Contact supportReply within a day

Filters

A frameless compact row under the field: drop borderless Selects or ghost Buttons in.

Inspect
New fileBlank document⌘N
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
CalendarToday
Starred
RecentLast 7 days
SettingsAccount and workspace⌘,
Documentation
What's newRelease notes
Contact supportReply within a day

Dialog and trigger shortcut

Press ⌘P anywhere on this page: this demo binds its own combo, and the default ⌘K opens the playground above. A pick or Escape closes it.

Inspect

Footer hints

4 hints at most, following the menu: ← → with tabs, Esc in a dialog. Pass hints for your own.

Inspect
CalendarToday
New fileBlank document⌘N
SettingsAccount and workspace⌘,
Search everywhereFiles, people, messages⌘⇧F
Toggle dark modeSystem, light, or dark⌘⇧L
Copy linkTo this page⌘⇧C
Invite peopleSend an email invite
Export as PDFPro plan
Home
Inbox3 unread
Starred
RecentLast 7 days
Documentation
What's newRelease notes
Contact supportReply within a day
Select↑↓Run↵

Custom rows

1 CommandMenuItem per row from renderItem: children replace the label, the icon and caps stay.

Inspect
New fileActions⌘N
Search everywhereActions⌘⇧F
Toggle dark modeActions⌘⇧L
Copy linkActions⌘⇧C
Invite peopleActions
Export as PDFActions
HomeGo to
InboxGo to
CalendarGo to
StarredGo to
RecentGo to
SettingsGo to⌘,
DocumentationHelp
What's newHelp
Contact supportHelp

API Reference: Item data

PropTypeDefaultDescription
valuestring—Unique id. The row's key and what aria-activedescendant points at.
labelstring—The row's text.
descriptionstring—Text after the label, at its size, 1 contrast step lower.
iconIconComponent—Leading icon.
shortcutstring—Caps at the trailing edge, e.g. "mod+p" or "⌘P". Display only.
keywordsstring[]—Extra terms the filter matches besides label and description.
groupstring—Heading the row lists under. Groups keep first-appearance order; ungrouped rows form an unlabelled section.
disabledbooleanfalseListed and greyed; the arrows and the pointer skip it.
onSelect() => void—Runs when the row is picked, before the root's onSelect.

API Reference: CommandMenu

PropTypeDefaultDescription
itemsCommandMenuItemData[]—The actions. Keep the array stable: the highlight resets to the first row when the rows change.
onSelect(item) => void—Runs when a row is picked, after the item's own onSelect.
filter(item, query: string) => boolean—Match an item against the query. Default: every word of the query appears in label, description, or keywords.
querystring—Controlled query.
defaultQuerystring""Initial query.
onQueryChange(query: string) => void—Called on every keystroke.
suggestionsstring[]—Values listed first, under suggestionsLabel, while nothing is typed. A suggested row leaves its own group.
suggestionsLabelstring"Suggestions"Heading of the suggestions section.
closeOnSelectbooleantrueInside CommandMenuDialog, a pick closes the dialog.
size"default" | "compact"—Pins field and rows to one size step. Omitted, both follow the SizeProvider.

API Reference: CommandMenuDialog

PropTypeDefaultDescription
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial open state.
onOpenChange(open: boolean) => void—Called when the dialog opens or closes, including from the shortcut.
shortcutstring | null"mod+k"The combo that toggles the dialog from anywhere: "mod" is ⌘ on a Mac and Ctrl elsewhere, joined with "+" to alt, shift, and one key. null binds nothing.
titlestring"Command menu"The dialog's name for screen readers.
descriptionstring"Search for a command to run."Read after the title.
modalbooleantrueTraps focus and locks page scroll while open.
containerHTMLElement | null—Portal target, to scope the dialog to a region.
classNamestring—Merged onto the panel. Anchored 12dvh from the top, sized by its rows up to min(440px, 76dvh).

API Reference: CommandMenuInput

PropTypeDefaultDescription
placeholderstring"Type a command or search…"Shown while nothing is typed.
iconIconComponent | nullsearchLeading icon. null drops it.

API Reference: CommandMenuTabs

PropTypeDefaultDescription
tabs{ value: string; label: string; icon?: IconComponent }[]—1 subtle tab each.
valuestring—The selected tab's value.
onValueChange(value: string) => void—Called on a pick. Derive items from the value.

API Reference: CommandMenuList

PropTypeDefaultDescription
renderItem(item, index: number) => ReactNode—Custom rows: return a CommandMenuItem per visible item. Default renders one from the item's data.
childrenReactNode—Static children, e.g. CommandMenuEmpty.

API Reference: CommandMenuItem

PropTypeDefaultDescription
valuestring—Which item this row is. Its data fills the row; props below override it.
labelstring—Overrides the item's label.
descriptionstring—Overrides the item's description.
iconIconComponent—Overrides the item's icon.
shortcutstring—Overrides the item's shortcut caps.
disabledboolean—Overrides the item's disabled state.
onSelect() => void—Overrides the item's onSelect.
childrenReactNode—Replaces the label and description. The icon and caps stay.

API Reference: CommandMenuFooter

PropTypeDefaultDescription
hints{ label: string; keys: string | string[] }[]—Replaces the default hints. A keys list draws 1 cap per entry.
childrenReactNode—Replaces the hints with your own content.

API Reference: CommandMenuShortcut

PropTypeDefaultDescription
keysstring | string[]—The combo, in the trigger syntax ("mod+shift+p") or pre-formatted ("⌘⇧P"). A list draws 1 cap per entry. Modifiers draw as symbols on a Mac and words elsewhere.