Command
A search line and a list that narrows as you type. Groups, shortcuts, and a dialog wrapper.
wire it to⌘K
Command Palette
Search for a command to run...
Installation
npx shadcn@latest add @afterglow/commandComposition
Component structure.
Command
- CommandInput
- CommandList
- CommandEmpty
- CommandGroup
- CommandItem
- CommandShortcut
- CommandItem
- CommandSeparator
CommandDialog
API Reference
Command
The palette itself, laid into a page.
CommandDialog
A dialog shell for a nested Command. title and description are its accessible name, read out rather than drawn, so set them to what the palette searches.
| Prop | Type | Default |
|---|---|---|
| title | string | "Command Palette" |
| description | string | "Search for a command to run..." |
| initialFocus | boolean | RefObject<HTMLElement | null> | function | - |
| showCloseButton | boolean | false |
Everything else is cmdk's API, documented there.