Command
FormsFast, composable, unstyled command menu for React.
Import
import { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut } from "@/components/ui/command";Usage
Default
A standard command menu with search, groups, and items.
No results found.
Calendar
Search Emoji
Calculator
Profile⌘P
Billing⌘B
Settings⌘S
Dialog
Command menu inside a dialog, triggered by a keyboard shortcut.
Press ⌘K
API Reference
filter—(value: string, search: string) => numberCustom filter function for items
loop—booleanWhether to loop selection at the end of the list
open—booleanControlled open state for dialog
onOpenChange—(open: boolean) => voidEvent handler for open state change
| Prop | Type | Default | Description |
|---|---|---|---|
filter | (value: string, search: string) => number | — | Custom filter function for items |
loop | boolean | — | Whether to loop selection at the end of the list |
open | boolean | — | Controlled open state for dialog |
onOpenChange | (open: boolean) => void | — | Event handler for open state change |