Command palette
Command palette component with search, groups, icons, hints and full keyboard navigation.
How to use it
Run npx @blossomui/react add command-palette, or copy src/components/UI/CommandPalette/CommandPalette.tsx into your React project and import it.
import { CommandPalette } from './components/ui/CommandPalette'Props
Command
| Prop | Type | Description |
|---|---|---|
| id (required) | string | |
| label (required) | string | |
| group | string | Section the command is listed under. |
| icon | ReactNode | |
| hint | string | Text shown at the right, for example a shortcut. |
| keywords | string[] | Extra words that also match the search. |
| onSelect (required) | () => void |
CommandPaletteProps
| Prop | Type | Description |
|---|---|---|
| label | string | Accessible name of the dialog. |
| color | string | Accent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default. |
| open (required) | boolean | |
| onClose (required) | () => void | |
| commands (required) | Command[] | |
| placeholder | string | |
| emptyText | string |