Command palette
A complete keyboard driven action surface with search, grouped results, and shortcuts.
npx shadcn@latest add @silicon-ui/command-paletteInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/command-paletteManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/command-palette/command-palette.tsx
- components/silicon-ui/command-palette/command-palette.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
items* | CommandItem[] | — |
placeholder | string | "Search commands" |
onSelect | (item: CommandItem) => void | — |
onClose | () => void | — |
label | string | "Command palette" |
autoFocus | boolean | false |
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens