Command
A command palette and search component powered by cmdk.
command-demo.app
No results.
New File⌘N
Search⌘K
Settings⌘S
Installation
terminal.sh
npx y2kui@latest add commandUsage
import {
Command,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandItem,
CommandShortcut,
} from "@/components/ui/command"
<Command className="w-72">
<CommandInput placeholder="Type a command..." />
<CommandList>
<CommandEmpty>No results.</CommandEmpty>
<CommandGroup heading="Actions">
<CommandItem>New File <CommandShortcut>⌘N</CommandShortcut></CommandItem>
</CommandGroup>
</CommandList>
</Command>Props
| Prop | Type | Default | Description |
|---|---|---|---|
CommandInput | see cmdk | — | Filterable search input. |
CommandEmpty | ReactNode | — | Shown when no results match. |
CommandGroup | { heading?: string } | — | Groups items under a label. |
CommandItem | see cmdk | — | Selectable command item. |
CommandShortcut | ReactNode | — | Keyboard hint label. |