
Usage
import { CommandPalette } from "@/registry/components/command-palette/command-palette";
<CommandPalette commands={[/* … */]} open onOpenChange={() => {}} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
commands | Command[] | ||
open | boolean | ||
onOpenChange | (open: boolean) => void | ||
placeholder? | string | "Type a command or search…" | |
hotkey? | boolean | true | Bind ⌘K / Ctrl+K globally to toggle the palette |
emptyText? | string | "No results." | Text when nothing matches |
inline? | boolean | false | Render 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).