items-
CommandPaletteItem[]The rows: { label, id?, icon?, description?, action?, group?, keywords?, shortcut?, items?, onSelect?, disabled? }. A row with items opens a page of its own; description adds a muted second line, and action is the word shown on the active row.
onSelect-
(item) => voidCalled for every chosen row that is not a page, after the row's own onSelect.
query-
stringControlled search text. Pass with onQueryChange.
defaultQuery""
stringSearch text on first render when uncontrolled.
onQueryChange-
(query: string) => voidCalled as the search text changes.
path-
number[]Controlled page as an index path: [] is the top, [3] the page row 3 opened. Pass with onPathChange.
defaultPath[]
number[]Page on first render when uncontrolled.
onPathChange-
(path: number[]) => voidCalled when a page opens or closes.
resetOnSelecttrue
booleanAfter a row runs, clears the search and goes back to the top page.
hintstrue
booleanShows the Move, Open and Back key hints under the list.
labelCommand palette
stringAccessible name of the search field.
autoFocusfalse
booleanFocuses the search field on mount, for a palette that opens in a dialog.
onEscape-
() => voidCalled on an Escape with no search to clear and no page to leave, and shows an Esc cap in the field. Close a dialog from here.
groupActions-
Record<string, CommandPaletteGroupAction>A button at the end of a group heading, keyed by group name: { label, onSelect }, such as Clear on a Recent group.
messages-
Partial<CommandPaletteMessages>Replaces any built-in string: the placeholder, the empty states, the back button name and the hints.
classNames-
CommandPaletteClassNamesSlot classes: root, field, list, item, indicator (the gliding highlight) and footer.