CommandMenu
1 field over every action. Type, arrow, Enter.
Installation
Install CommandMenu from the Fluid Effect UI registry.
Playground
Basic
Type to filter, use the arrow keys to move, and press Enter to run a command.
Descriptions, shortcuts, disabled rows
Arrow keys skip disabled rows. Type clipboard to match a command by keyword.
Suggestions
Recent commands appear first until you type. The remaining matches stay in their groups.
Tabs
Click a tab, or press the Left and Right arrow keys from the search field.
Filters
Group or sort results using the controls below the search field.
Dialog and trigger shortcut
Press ⌘P or Ctrl+P to open the first dialog. The second button has no shortcut. A choice or Escape closes either dialog.
Footer hints
Custom rows
Customize the row label while retaining native selection, icons, and shortcut caps.
API Reference
Types come from the public API. A dash indicates no default is documented here.
CommandMenu props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Show type((events: ComboboxEvents) => NoInfer<Msg> | undefined) | { readonly RequestedClose: (event: { readonly _tag: "RequestedClose"; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "cancel-open" | "input-press" | "input-change" | "input-clear" | "clear-press" | "chip-remove-press"; }) => NoInfer<Msg> | undefined; readonly RequestedOpen: (event: { readonly _tag: "RequestedOpen"; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "cancel-open" | "input-press" | "input-change" | "input-clear" | "clear-press" | "chip-remove-press"; }) => NoInfer<Msg> | undefined; readonly Picked: (event: { readonly _tag: "Picked"; readonly value: string | readonly string[] | null; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "cancel-open" | "input-press" | "input-change" | "input-clear" | "clear-press" | "chip-remove-press"; }) => NoInfer<Msg> | undefined; readonly Settled: (event: { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined; readonly Highlighted: (event: { readonly _tag: "Highlighted"; readonly value: string | null; readonly index: number; readonly reason: "none" | "keyboard" | "pointer"; }) => NoInfer<Msg> | undefined; readonly RequestedInputValue: (event: { readonly _tag: "RequestedInputValue"; readonly inputValue: string; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "cancel-open" | "input-press" | "input-change" | "input-clear" | "clear-press" | "chip-remove-press"; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.id | string | Required | |
props.items | readonly CommandMenuItem[] | Required | |
props.query | string | Required | |
props.suggestions | readonly string[] | — | |
props.suggestionsLabel | string | — | |
ariaLabel | string | Required | |
size | SizeVariant | 'default' | |
shape | ShapeVariant | 'rounded' | |
className | string | — | |
placeholder | string | 'Type a command or search…' | |
emptyText | string | 'No results found.' | |
reducedMotion | "user" | "always" | "never" | 'user' | |
filter | (item: CommandMenuItem, query: string) => boolean | — | |
header | View.Input<Msg, R> | — | |
tabs | Show type{ readonly value: string; readonly items: ReadonlyArray<{ readonly value: string; readonly label: string; }>; readonly onSelected: (value: string) => NoInfer<Msg>; } | — | |
mac | boolean | false | |
footer | View.Input<Msg, R> | ((activeItem: CommandMenuItem | undefined) => View.Input<Msg, R>) | — | |
renderIcon | (item: CommandMenuItem) => View.Content<Msg, R> | — | |
renderItemLabel | (item: CommandMenuItem) => View.Content<Msg, R> | — |
CommandMenuDialog
| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "RequestedClose"; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "close-watcher"; } | { readonly _tag: "RequestedOpen"; readonly triggerId: string | null; } | { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined) | { readonly RequestedClose: (event: { readonly _tag: "RequestedClose"; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "close-watcher"; }) => NoInfer<Msg> | undefined; readonly RequestedOpen: (event: { readonly _tag: "RequestedOpen"; readonly triggerId: string | null; }) => NoInfer<Msg> | undefined; readonly Settled: (event: { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.open | boolean | Required | |
props.id | string | undefined | — | |
props.modal | boolean | "trap-focus" | undefined | — | |
props.topLayer | boolean | undefined | — | |
props.finalFocus | boolean | undefined | — | |
props.holdExit | boolean | undefined | — | |
props.triggerId | string | null | undefined | — | |
props.openMethod | "touch" | "keyboard" | "mouse" | "pen" | null | undefined | — | |
props.keepMounted | boolean | undefined | — | |
props.disablePointerDismissal | boolean | undefined | — | |
props.forceRenderBackdrop | boolean | undefined | — | |
props.nested | boolean | undefined | — | |
props.initialFocus | boolean | undefined | — | |
shortcut | string | null | (options.shortcut === null ? '' : 'mod+k') | |
shortcutScopeId | string | '' | |
onShortcut | (open: boolean) => Msg | — | |
title | string | Required | |
description | string | 'Search for a command to run.' | |
trigger | View.Input<Msg, R> | — | |
triggerButton | Omit<ButtonProps<Msg, R>, "onPress"> | — | |
menu | CommandMenuOptions<Msg, R> | Required | |
panelClassName | string | — |