Command
Command combines a dialog and autocomplete list for fast keyboard-driven navigation, search, and actions.
Purpose
Command combines a dialog and autocomplete list for keyboard-driven navigation, search, and actions. It may also render as a standalone embedded command list.
Inline command list
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/commandImport
import { Command, CommandCollection, CommandCreateHandle, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut } from "@/components/ui/command";Need the machine-readable source metadata? View registry JSON.
Usage
Use Command for keyboard-first palettes and scoped action lists. Keep items grouped by task, not by implementation file.
import { Command, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command";
export function Example() {
return (
<Command>
<CommandInput aria-label="Command" placeholder="Search commands" />
<CommandList>
<CommandGroup><CommandItem>Open settings</CommandItem></CommandGroup>
</CommandList>
</Command>
);
}Examples
One primitive covers the palette dialog and embedded lists. The dialog brings its own shell with panel and footer; standalone lists sit in a simple bordered wrapper.
Command palette dialog
Controlled open state with a Cmd+J listener, grouped items, CommandPanel and a CommandFooter with keyboard hints.
Grouped items
Standalone command
Controlled filter
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
CommandDialogprovides modal focus management; use the standaloneCommandcomposition only when the list belongs in the page.CommandCreateHandleopens or closes the dialog from detached triggers or imperative application flows.autoHighlightacceptsfalse,true, or"always"and defaults to"always", so the first result is ready for Enter.- Use
CommandGroup,CommandSeparator, andCommandShortcutto make results scannable. CommandEmptyreports no matches;CommandFootermay explain keyboard controls.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Modal Command uses native Dialog backdrop and popup motion.
- Filtering and highlighting come from Autocomplete; do not wrap either layer in a second transition.
- Active items use a pointer cursor while CommandInput keeps a text cursor.
Accessibility
- CommandInput receives focus and must have a visible or accessible name.
- Keep keyboard navigation, Enter selection, Escape dismissal, outside click, focus trapping, and focus restoration native.
- Every CommandItem needs a clear label. Shortcuts are supporting context, not the only action name.
- Dialog triggers need visible text or an accessible label.
Implementation Guidance
- Use Command for search-driven navigation and actions, not as a generic menu or select.
- Choose modal or standalone composition deliberately.
- Preserve native Dialog and Autocomplete focus, filtering, cursor, and motion behavior.