Command
Command palette — a modal Dialog hosting a filterable Listbox.
Usage
import {Command} from 'kinu';
<Dialog id="cmdk">
<Dialog.Trigger><Button>⌘K</Button></Dialog.Trigger>
<Command>
<Command.Input placeholder="Search…" />
<Command.List>
<Item>Search docs</Item>
</Command.List>
</Command>
</Dialog>
Exports
| Name | Description | Rendered HTML |
|---|---|---|
| Command | Component | — |
Static Shortcuts
Command.Input = ListboxInputCommand.List = ListboxList
Notes
- A pure composition of shipped parts: a modal
Dialoghosting aListbox. The Listbox supplies substring filtering (Command.Input) and keyboard navigation; the Dialog supplies the modal + focus trap. No fuzzy-search engine. - Place it inside a
Dialogand open with aDialog.Triggeror a hotkey (commandfor+command="show-modal"). - Items are regular
Items, so they supportshortcut,destructive, andhref.
_Source: src/components/command/index.tsx