Installation
About
The Command component is built on top ofcmdk by Dip.
Usage
Component API
Command
The root command menu component. Props:- Standard React component props
className- Additional CSS classes
CommandDialog
A command menu rendered inside a dialog. Props:title- Dialog title (default:"Command Palette")description- Dialog descriptionshowCloseButton- Show close button (default:true)open- Control dialog open stateonOpenChange- Callback when open state changes
CommandInput
The search input field. Props:placeholder- Placeholder textvalue- Controlled input valueonValueChange- Callback when value changes
CommandList
Container for command items with scroll overflow. Props:className- Additional CSS classes
CommandEmpty
Displayed when no results are found. Props:- Children to display when empty
CommandGroup
Groups related commands together. Props:heading- Group heading textclassName- Additional CSS classes
CommandItem
An individual command item. Props:onSelect- Callback when item is selecteddisabled- Disable the itemvalue- Search value for filtering
CommandShortcut
Displays keyboard shortcuts. Props:- Children to display (typically keyboard shortcut text)
CommandSeparator
Visual separator between groups.Examples
Dialog
Open the command menu in a dialog:Shortcuts
Add keyboard shortcuts to command items:With Icons
Add icons to command items:Groups and Separators
Organize commands with groups and separators:Accessibility
- Full keyboard navigation support
- ARIA labels and roles
- Focus management
- Screen reader compatible