Command palette preview

Command palette

A ⌘K launcher: type to fuzzy-filter grouped commands, arrow to highlight, Enter to run.

  • Group
    Command menus
  • Origin
    Inspired · Original (this library)
  • License
    MIT
  • Added
    Oct 22
npx shadcn@latest add @deank/command-palette

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { CommandPalette } from "@/registry/components/command-palette/command-palette";

<CommandPalette commands={[/* … */]} open onOpenChange={() => {}} />

Props

PropTypeDefaultDescription
commandsCommand[]
openboolean
onOpenChange(open: boolean) => void
placeholder?string"Type a command or search…"
hotkey?booleantrueBind ⌘K / Ctrl+K globally to toggle the palette
emptyText?string"No results."Text when nothing matches
inline?booleanfalseRender in place instead of as a modal over the page (for docs and demos)

When to use

Apps with more actions or pages than fit in the navigation; power-user shortcuts; jump-to search over a known list.

When not to use

Free-text search over remote content with result previews (build a search page); fewer than about eight actions (use a menu like profile-menu).

Related

Dialog · Goo dropdown · Filter menu