CommandPalette
Keyboard-first access to actions and records, matched on a subsequence.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Keyboard-first access to actions and records, matched on a subsequence.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/command-palette
import { CommandPalette } from '@/components/prism/CommandPalette';
In a no-build prototype, read it from the bundle instead: const { CommandPalette } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
isOpen | boolean | — | |
onClose | () => void | — | |
items | CommandItem[] | — | |
placeholder | string | — | |
emptyMessage | React.ReactNode | — | |
onSelect | (item: CommandItem) => void | — | |
footer | React.ReactNode | — | |
className | string | — |