Back to components
Spring Command Palette React component

What is this?

A command palette React UI: a ⌘K search modal React teams can paste in like a react cmdk component. Pages, Actions, and Recent come from a props array and filter as you type. Drop it onto SaaS dashboards, dev tools, and admin panels. Dark and light, with spring motion and full keyboard support.

Use cases

  • SaaS dashboards, where a command palette React shortcut jumps to a page or runs an action.
  • Dev tools that need a react cmdk component: type to filter, then choose a row.
  • Admin panels that keep recent records and actions in one ⌘K search modal React users already expect.

Props

PropTypeDefaultDescription
itemsSpringCommandPaletteItem[]demo itemsRows passed as an array. Each item has id, label, group (pages, actions, or recent), and optional hint and keywords. The demo rows are fictional.
variant"dark" | "light""dark"Dark or light panel, trigger, and stage.
openLabelstringOpen palette (⌘K)Label of the button that opens the palette. Touch devices use this button.
placeholderstringSearch commands…Placeholder on the combobox.
titlestringCommand paletteAccessible name of the dialog.
pagesLabelstringPagesHeading for the pages group.
actionsLabelstringActionsHeading for the actions group.
recentLabelstringRecentHeading for the recent group.
emptyLabelstringNo matching commandsShown when the filter matches nothing.
onSelect(item) => void—Fires when Enter or a click chooses a row. The dialog then closes. Selection is a demo and does not navigate.
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial open state when open is not controlled.
onOpenChange(open: boolean) => void—Called when the palette opens or closes.
classNamestring—Extra classes on the trigger wrapper.
Spring Command Palette — React component | DesignLayer