<Card className="w-full p-0">
<Command aria-label="Command menu">
<SearchField aria-label="Search">
<InputGroup>
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<Input placeholder="Type a command or search..." />
<InputGroupAddon className="[--addon-button-inset:--spacing(2)]">
<Button isIconOnly variant="quiet">
<XIcon aria-hidden="true" />
</Button>
</InputGroupAddon>
</InputGroup>
</SearchField>
<ListBox aria-label="Commands" onAction={() => console.log("action")}>
<ListBoxSection>
<ListBoxSectionHeader>Suggestions</ListBoxSectionHeader>
<ListBoxItem textValue="Calendar">
<CalendarIcon />
<span>Calendar</span>
</ListBoxItem>
<ListBoxItem textValue="Search Emoji">
<SmileIcon />
<span>Search Emoji</span>
</ListBoxItem>
<ListBoxItem textValue="Calculator">
<CalculatorIcon />
<span>Calculator</span>
</ListBoxItem>
</ListBoxSection>
<Separator />
<ListBoxSection>
<ListBoxSectionHeader>Settings</ListBoxSectionHeader>
<ListBoxItem textValue="Profile">
<UserIcon />
<span>Profile</span>
<Kbd>⌘P</Kbd>
</ListBoxItem>
<ListBoxItem textValue="Billing">
<CreditCardIcon />
<span>Billing</span>
<Kbd>⌘B</Kbd>
</ListBoxItem>
<ListBoxItem textValue="Settings">
<SettingsIcon />
<span>Settings</span>
<Kbd>⌘S</Kbd>
</ListBoxItem>
</ListBoxSection>
</ListBox>
</Command>
</Card>npx shadcn@latest add @dotui/commandUse command menus to provide users with a searchable list of commands or actions.
import { Command, CommandContent, CommandInput, CommandItem } from "@/components/ui/command";<Command>
<CommandInput placeholder="Type a command..." />
<CommandContent>
<CommandItem textValue="Create file">Create new file</CommandItem>
<CommandItem textValue="Open file">Open file</CommandItem>
</CommandContent>
</Command>Use the controls below to experiment with different command props and see the live preview and code update.
<Command className="w-[300px]">
<SearchField placeholder="Type a command..." />
<ListBox>
<ListBoxSection>
<ListBoxSectionHeader>Actions</ListBoxSectionHeader>
<ListBoxItem textValue="Create new file">Create new file</ListBoxItem>
<ListBoxItem textValue="Create new folder">Create new folder</ListBoxItem>
<ListBoxItem textValue="Open file">Open file</ListBoxItem>
</ListBoxSection>
</ListBox>
</Command>Missing description.
Supports all div attributes.
Missing description.
| Prop | Type | Default | |
|---|---|---|---|
string | — | ||
boolean | — | ||
boolean | — | ||
ReactNode | function | — | ||
union | — | ||
DOMRenderFunction<"div", SearchFieldRenderProps> | — | ||
union | 'search' | ||
string | — | ||
string | — | ||
function | — | ||
Missing description.
| Prop | Type | Default | |
|---|---|---|---|
boolean | — | ||
DragAndDropHooks<NoInfer<T>> | — | ||
"grid" | "stack" | 'stack' | ||
Orientation | 'vertical' | ||
DOMRenderFunction<"div", ListBoxRenderProps> | — | ||
ReactNode | function | — | ||
Iterable<T> | — | ||
ReactNode | function | — | ||
readonly any[] | — | ||
SelectionMode | — | ||
SelectionBehavior | "toggle" | ||
Iterable<Key> | "all" | — | ||
Iterable<Key> | "all" | — | ||
function | — | ||
Iterable<Key> | — | ||
boolean | — | ||
boolean | — | ||
boolean | — | ||
boolean | — | ||
"clearSelection" | "none" | 'clearSelection' | ||
Last updated on 5/22/2026