CommandPalette
Keyboard-driven command search overlay for quick navigation and action execution.
Examples
Basic with suggestions
A simple command palette that filters a flat list as you type.
With grouped results
Results organised into labelled groups with separators.
With recent items
Shows recent items when the query is empty; switches to search results on input.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { CommandPalette } from "@rokle/components";import { CommandPalette } from "@rokle/components";
export function Example() {
return <CommandPalette />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| commands | Command[] | - | List of available commands with label and action. |
| open | boolean | - | Whether the palette is visible. |
| onOpenChange | (open: boolean) => void | - | Called when open state changes. |