Skip to content
SevenUI
Sign in
On this page

Command

A fast, composable command palette built on the Base UI Autocomplete primitive.

Suggestions
Calendar
Search Emoji
Calculator
New Document
Recent Files
Settings
Profile⇧⌘P
Billing⌘B
Settings⌘S
Log out⇧⌘Q

Installation

Bash

Usage

Dialog

CommandDialog wraps Command in a Base UI Dialog so the palette can be toggled with a keyboard shortcut and rendered as a modal overlay. Because the dialog unmounts its content on close, filter and highlight state reset for free every time it reopens.

Press ⌘K or click below

Command Palette

Search for a command to run...

API reference

Built from scratch on the Base UI Autocomplete primitive in inline mode — this is SevenUI’s Radix-free replacement for cmdk.

Command

Extends the Autocomplete Root (locked to inline open autoHighlight="always" keepHighlight).

PropTypeDefault
itemsgrouped item data passed to render props—
filtercustom match function (null disables)substring on label
filteredItemsexternally computed results—

CommandDialog

Wraps Command in the Dialog component with sr-only title and description.

PropTypeDefault
titlestring"Command Palette"
descriptionstring"Search for a command to run..."
showCloseButtonbooleanfalse
classNamestring — on the DialogContent—

Data-driven filtering (intentional divergence from cmdk). cmdk filters by reading each item’s rendered DOM text. Command instead filters the items array you pass to the root — CommandList and CommandGroup take a function child ((item) => ReactElement) that Base UI calls once per item currently matching the input value, rather than a plain node. Items use the { value, label } shape; the default filter is a locale-aware substring match against .label. Pass a custom filter function for fuzzy matching, or filter={null} together with a filteredItems prop to drive results from an async search yourself.

Keyboard model. Virtual focus never leaves the input — the highlighted item is tracked via aria-activedescendant, not real DOM focus. Arrow keys move the highlight, Enter activates the highlighted item’s onClick, and inside CommandDialog, Escape closes the dialog (inline Autocomplete mode disables Base UI’s own dismissal so the keypress bubbles up to the Dialog root).

The component ships with unit tests covering rendering, filtering, the empty state, and keyboard activation — see packages/registry/tests/command.test.tsx.

ComponentRenders
CommandAutocomplete.Root (inline open autoHighlight="always" keepHighlight) plus a styled container
CommandInputAutocomplete.Input inside an Input Group with a trailing search-icon addon
CommandListAutocomplete.List — takes a function child, one call per group/item
CommandGroupAutocomplete.Group + Autocomplete.GroupLabel (heading prop) + Autocomplete.Collection
CommandItemAutocomplete.Item — highlighted state via data-highlighted
CommandEmptyAutocomplete.Empty — always mounted as a role="status" live region
CommandShortcutA styled <span> for trailing keybinding hints
CommandSeparatorAutocomplete.Separator
CommandDialogThe Dialog component wrapping Command, with title / description rendered as sr-only text

Was this page helpful?