Components › Actions
Command
A searchable, keyboard-driven list of actions. CommandDialog wraps it in a modal with a hotkey.
Installation
npx plankui@latest add commandUsage
import { Command } from "@/components/ui/command";
<Command groups={[{ heading: "Settings", items: [{ value: "profile", label: "Profile" }] }]} />
<CommandDialog open={open} onOpenChange={setOpen} groups={groups} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| groups | { heading?: string; items: CommandItem[] }[] | required | Grouped items. |
| CommandItem | { value, label, icon?, shortcut?, keywords?, disabled?, onSelect? } | One row. | |
| onSelect | (item) => void | Called when an item is chosen. | |
| CommandDialog.hotkey | string | false | "k" | Letter that opens it with ⌘ or Ctrl. |