Command

Searchable command palette. Built on cmdk — handles filtering, keyboard nav, and selection.

Basic

<Command className="border border-border shadow-overlay">
  <CommandInput placeholder="Type a command or search…" />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>

    <CommandGroup heading="Suggestions">
      <CommandItem>Calendar</CommandItem>
      <CommandItem>Search emoji</CommandItem>
      <CommandItem>Find a file</CommandItem>
    </CommandGroup>

    <CommandSeparator />

    <CommandGroup heading="Settings">
      <CommandItem>
        Profile
        <CommandShortcut>⌘P</CommandShortcut>
      </CommandItem>
      <CommandItem>
        Billing
        <CommandShortcut>⌘B</CommandShortcut>
      </CommandItem>
      <CommandItem>
        Settings
        <CommandShortcut>⌘,</CommandShortcut>
      </CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Exports

ExportRole
CommandRoot.
CommandInputSearch input with leading icon.
CommandListScroll container (max-h 300px).
CommandEmptyFallback when filter yields nothing.
CommandGroupTitled section. Pass `heading`.
CommandSeparatorDivider.
CommandItemA row. Filters + keyboard nav via cmdk.
CommandShortcutKeyboard-hint text.

Source

packages/react/src/components/command.tsx