Components › Actions

Command

A searchable, keyboard-driven list of actions. CommandDialog wraps it in a modal with a hotkey.

Installation

npx plankui@latest add command

Usage

import { Command } from "@/components/ui/command";

<Command groups={[{ heading: "Settings", items: [{ value: "profile", label: "Profile" }] }]} />
<CommandDialog open={open} onOpenChange={setOpen} groups={groups} />

API reference

PropTypeDefaultDescription
groups{ heading?: string; items: CommandItem[] }[]requiredGrouped items.
CommandItem{ value, label, icon?, shortcut?, keywords?, disabled?, onSelect? }One row.
onSelect(item) => voidCalled when an item is chosen.
CommandDialog.hotkeystring | false"k"Letter that opens it with ⌘ or Ctrl.

View the source on GitHub