Aliases
command menu, quick actions
CommandPaletteSearchable command list with grouping and an optional keyboard shortcut.
Stage palette: closed
Aliases
command menu, quick actions
Foundations
CommandPalette to search a set of actions.CommandPalette as a replacement for everyday primary navigation.command shell
surface Centered overlay surface that owns the filter input and result list.
command query
input Query input that filters commands.
command option
item Single command row with optional section and shortcut metadata.
| Name | Type | Default | Description |
|---|---|---|---|
open | boolean | false | Controlled open state. |
items | Array<{ id: string; label: string; section?: string; shortcut?: string; keywords?: string[]; disabled?: boolean }> | — | Command definitions available in the palette. |
query | string | '' | Controlled query string. |
placeholder | string | 'Search commands' | Query input placeholder. |
emptyTitle | string | 'No commands found' | Heading shown when filtering returns no results. |
emptyDescription | string | 'Change or clear the search.' | Optional empty-state guidance. |
hotkey | 'mod+k' | false | false | Enables or disables the global mod+k shortcut. |
onOpenChange | (detail: { open: boolean }) => void | — | Runs when the palette opens or closes. |
onQueryChange | (detail: { query: string }) => void | — | Runs when the query changes. |
onAction | (detail: { id: string }) => void | — | Runs when a command is executed. |
theme | ThemeContract | — | Sets the theme used to resolve component styles. |
| Name | Payload | Description |
|---|---|---|
openchange | { open: boolean } | Fires when an overlay-style component opens or closes through user interaction. |
querychange | { query: string } | Fires when the filter query changes. |
action | { id: string } | Fires with the executed command ID. |
| Name | Description |
|---|---|
default | CommandPalette is data-driven and does not expose command item slots. |
Variants
default: One centered command shell with grouped results and optional hotkey.Sizes
default: CommandPalette uses one width recipe tuned for search and action scanning.States
closed: Palette hiddenopen: Palette visiblehighlighted: One command is active for keyboard executionSemantics
Keyboard
mod+k shortcut opens it.Screen readers
Checklist
A centered command surface with grouped actions.
<CommandPalette open={isOpen} items={commands} onAction={(detail) => runCommand(detail.id)} /> Enable the shortcut when the app provides searchable commands.
<CommandPalette hotkey="mod+k" items={commands} open={isOpen} onOpenChange={(detail) => isOpen = detail.open} /> Control the query when search state also drives analytics or suggestions elsewhere in the app.
<CommandPalette open={isOpen} query={query} onQueryChange={(detail) => query = detail.query} items={commands} /> Calculated fixtures; browser evidence is not collected. Layout estimates use declared text behavior and maximum token values.