A command palette primitive for searchable actions and navigation. Use it inline or control it from a button when mounted inside a dialog.
import Command from "@radui/ui/Command"Import all parts of the component and piece them together.
The inline command root. It owns filtering, keyboard navigation, and item registration.
| Prop | Type | Default |
|---|---|---|
value | string | — |
defaultValue | string | "" |
onValueChange | function | — |
label | string | "Command menu" |
shouldFilter | boolean | true |
filter | (value, search, keywords) => number | — |
loop | boolean | false |
A dialog-mounted command root built on the Rad UI dialog primitive.
| Prop | Type | Default |
|---|---|---|
open | boolean | — |
onOpenChange | function | — |
onClickOutside | function | — |
container | Element | — |
A selectable command option.
| Prop | Type | Default |
|---|---|---|
value | string | — |
keywords | string[] | [] |
onSelect | (value: string) => void | — |
disabled | boolean | false |
forceMount | boolean | false |
| Shortcut | Description |
|---|---|
| ArrowDown | Moves the active selection to the next available command item. |
| ArrowUp | Moves the active selection to the previous available command item. |
| Home | Moves the active selection to the first available command item. |
| End | Moves the active selection to the last available command item. |
| Enter | Runs the active command from the input, or the focused command item from the list. |
| Space | Runs the focused command item when focus is inside the list. |
| Escape | Closes the command palette when it is rendered with Command.Dialog. |
| Tab | Moves focus through or out of the command palette using the normal page tab order. |
| Reference | What Rad UI follows |
|---|---|
| Combobox pattern | Uses editable combobox semantics for the search input that controls the command results. |
| Listbox pattern | Uses listbox option semantics for selectable command results and active item state. |
| Dialog modal pattern | Uses modal dialog semantics when Command.Dialog presents the palette in a portal. |