Command
Command provides the root container for cmdk and applies the base styles.
Import from "@desk/ui/components/command".
Usage
import { Command, commandAnatomy, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@desk/ui/components/command";Best practices
For a ⌘K overlay wrap
CommandinCommandDialog—Commandalone is the inline, non-floating palette container.Compose
CommandInput/CommandList/CommandGroup/CommandIteminside; a plain click-triggered action menu isDropdownMenu.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | Accessible title for the dialog (visually hidden by default). | |
| description | string | Accessible description for the dialog (visually hidden by default). | |
| className | string | Extra class names applied to the | |
| showCloseButton | boolean | Whether to show the dialog close button. | |
| shouldFilter | boolean | When | |
| contentProps | Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement> & import("../dialog/dialog-content").DialogContentExtras, "children"> & React.HTMLAttributes<HTMLDivEleme | Extra props applied to the rendered dialog content element. |
Also exports
- component
Command - const
commandAnatomy - component
CommandEmpty - component
CommandGroup - component
CommandInput - component
CommandItem - component
CommandList - component
CommandSeparator - component
CommandShortcut
Anatomy
Command
commandCommand palette / search interface
CommandInput
command-inputSearch input field
CommandList
command-listResults container
CommandEmpty
command-emptyNo results message
CommandGroup
command-groupGrouped items with heading
CommandItem
command-itemSelectable command item
CommandSeparator
command-separatorVisual divider
CommandShortcut
command-shortcutKeyboard shortcut hint
Composition
Used by