Skip to content

Command

Provides a searchable command menu that lets users navigate pages, find resources, and trigger shortcuts directly from their keyboard.

7.6 KB
•
Updated on September 20, 2026

Installation

Bash

Usage

Code

Anatomy

Code

Accessibility

  • Keyboard-first navigation with live search announcement.
  • Selection updates seamlessly using aria-selected attributes.

Keyboard Interactions

API Reference

Command

The root component that wraps the autocomplete functionality. It's an alias for Autocomplete.Root with sensible defaults for command palette behavior: autoHighlight="always", keepHighlight={true}, and open={true}.

CommandDialog

A wrapper component that provides the dialog root functionality. It's an alias for Dialog.Root from Base UI.

CommandDialogTrigger

The trigger button that opens the command dialog. Renders as a button by default.

CommandDialogPopup

The popup content container that displays the command palette inside a dialog.

CommandInput

The search input field with an integrated search icon. Automatically includes a search icon via startAddon and is sized to lg by default.

CommandList

A scrollable container for command items. It wraps AutocompleteList with scroll functionality.

CommandPanel

A container component that provides styling for command content outside of dialogs. Useful when building standalone command interfaces with a bordered, elevated appearance.

CommandEmpty

Displays a message when no results are found.

CommandGroup

Groups related command items together. Wraps AutocompleteGroup.

CommandGroupLabel

Displays a label for a command group.

CommandItem

An individual selectable command item. Extends AutocompleteItem.

CommandSeparator

A visual separator between command groups or items. Includes default vertical spacing with my-2 className.

CommandShortcut

Displays keyboard shortcuts in a styled span element.

CommandFooter

A footer section for displaying hints or additional keyboard shortcuts. Renders as a styled div with padding and border.

CommandCollection

Used within CommandGroup to wrap items when using grouped data. It's an alias for AutocompleteCollection from the Autocomplete component.

Examples

Command palette with AI assistant

With Keyboard Shortcut

You can add a keyboard shortcut to open the command palette:

Code

With Grouped Items

Code

Standalone Command (Without Dialog)

You can use the Command component without a dialog wrapper:

Code