Components

Command

A fast, composable command menu built on cmdk — fuzzy-searchable items, grouping, keyboard shortcuts, and full keyboard navigation out of the box.

Basic usage

Compose Command with an input, list, and one or more groups. Type to filter the items live.

Groups & shortcuts

Organise items with CommandGroup headings, divide sections with CommandSeparator, and trail each item with a right-aligned CommandShortcut.

Disabled & empty states

Mark an item disabled to skip it during navigation, and provide a CommandEmpty fallback for when no item matches the search.

Props

Command root props (forwarded to cmdk):

PropTypeDefaultDescription
valuestringControlled selected value. Pair with onValueChange. Omit for uncontrolled behaviour managed by cmdk.
onValueChange(value: string) => voidFires when the highlighted item changes.
filter(value, search, keywords) => numberfuzzy matchCustom scoring function controlling which items match the current search.
shouldFilterbooleantrueWhether the list filters automatically. Set false to filter server-side.
loopbooleanfalseWhether arrow-key navigation wraps from the last item back to the first.
classNamestringAdditional Tailwind classes to merge onto the root element.

CommandItem props:

PropTypeDefaultDescription
valuestringtext contentThe value used for filtering and matching. Defaults to the item’s text.
onSelect(value: string) => voidCalled when the item is chosen via click or Enter.
disabledbooleanfalseRemoves the item from keyboard navigation and dims it.
keywordsstring[]Extra terms that should match this item during search.

Accessibility

  • The menu implements the combobox/listbox ARIA pattern — the input owns the list and announces the active option to screen readers.
  • Full keyboard support: / move between items, Enter selects, and typing filters the list.
  • Disabled items expose data-disabled and are skipped by arrow-key navigation, never receiving focus.
  • Group headings are linked to their options via aria-labelledby, giving assistive tech the section context.