Command
A command palette component for searching and executing actions.
A searchable command menu for quick actions.
Usage
import {
Command,
CommandInput,
CommandList,
CommandGroup,
CommandItem,
CommandEmpty,
} from "@delphi/ui";
export function Example() {
return (
<Command>
<CommandInput placeholder="Search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Actions">
<CommandItem>Action 1</CommandItem>
<CommandItem>Action 2</CommandItem>
</CommandGroup>
</CommandList>
</Command>
);
}API Reference
| Component | Description |
|---|---|
Command | Root wrapper with search functionality |
CommandInput | Search input field |
CommandList | Container for results |
CommandGroup | Groups related items with optional heading |
CommandItem | Individual selectable item |
CommandEmpty | Shown when no results match |
CommandSeparator | Visual divider between groups |
Use ⌘K (Cmd+K) as the keyboard shortcut to open
Include a
CommandEmpty state for no resultsGroup related items with
CommandGroup and clear headingsShow keyboard shortcuts for common actions
Keep the search instant and responsive
Include too many items — keep it focused on frequent actions
Nest command menus inside other command menus
Use for simple navigation — it's meant for power users
Require scrolling through hundreds of items