Atomx Docs
Components

Command

A fast, composable command palette with filtering, keyboard navigation, and optional dialog mode — built on cmdk.

Install

npx shadcn@latest add https://atomx.acau.net/r/command.json

Usage

Command wraps cmdk's Command primitive. Use CommandInput for the search field, CommandList to contain results, CommandGroup for labelled sections, and CommandItem for individual entries. CommandEmpty is displayed when no items match the query.

<Command>
  <CommandInput placeholder="Type a command..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Actions">
      <CommandItem>New file</CommandItem>
      <CommandItem>Open settings</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

For a full-screen modal palette, wrap everything in CommandDialog (which composes Dialog + Command).

Preview

Props

Command extends React.ComponentPropsWithoutRef<typeof CommandPrimitive>.

ComponentNotable props
Commandfilter — custom filter function (value, search) => number.
CommandInputStandard <input> props; placeholder.
CommandListScrollable container for groups and items.
CommandGroupheading — section label string.
CommandItemvalue — the string used for filtering; onSelect — called when selected.
CommandEmptyRendered when CommandList has no visible items.
CommandSeparatorHorizontal rule between groups.
CommandShortcutInline span for keyboard shortcut hints.