CommandPalette
Markdown for agentsCmd+K style command palette with lexical search, sectioned results and full keyboard navigation.
npx slipstream-ui@latest add command-palettePlayground
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | required | Controlled visibility |
| onOpenChange | (open: boolean) => void | required | Open/close requests |
| commands | Command[] | required | { id, label, section?, keywords?, shortcut? } |
| onSelect | (command: Command) => void | required | Chosen command handler |
| placeholder | string | Type a command… | Input placeholder |
Accessibility
- Combobox pattern with aria-expanded, aria-controls and aria-activedescendant
- Arrow keys cycle options, Enter selects, Escape closes; focus stays in the input
- Options are role=option with aria-selected marking the active item