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

ComponentDescription
CommandRoot wrapper with search functionality
CommandInputSearch input field
CommandListContainer for results
CommandGroupGroups related items with optional heading
CommandItemIndividual selectable item
CommandEmptyShown when no results match
CommandSeparatorVisual divider between groups
Use ⌘K (Cmd+K) as the keyboard shortcut to open
Include a CommandEmpty state for no results
Group related items with CommandGroup and clear headings
Show 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
ESC
No results found