Skip to Content
Navigation & Menus@hacline/ui/command

Command

Filter and execute a set of named commands.

Usage

Type a command keyword, then press Enter or click a result. Selected actions are passed to your application via onAction, and commands can be organized into groups.

Workspace
New draft
Open activity log
Waiting for a command

Switching Between Command Pages

Open the export format page first, then select Markdown or HTML. Press Backspace while the search input is empty to return to the previous page.

Choose export format
Export format: Markdown

Parts

PartDescriptionExtended Props
CommandEmpty
Shown while no command matches. Its message is announced when it appears. Place it outside the list.—
CommandGroup
A group of commands. It hides while none of its commands matches the search.—
CommandGroupLabel
A group's heading, which names it.—
CommandInput
The search field. It keeps focus while arrow keys move the highlight. Name it with aria-label.
size
CommandItem
A command. Pressing it, or Enter while it's highlighted, runs it, with its value passed to the command's onAction.—
CommandItemIcon
An icon inside a command. Screen readers, typeahead and filtering skip it, and mirror flips it in right-to-left text.—
CommandItems
Renders data commands. Used by data command lists, and available for custom layouts.—
CommandItemText
The command's text, with the part the search matched in <mark>. Without string content, it shows the command's label.—
CommandList
The listbox. Without children, it renders the command's items, ranked as the user types.—
CommandPage
Commands shown while this page is on top. Without value, it's the first page. Renders no element.—
CommandSeparator
A line between groups. Composed separators hide while the list is filtered.—
CommandShortcut
The keys of a command's shortcut, formatted for the platform. Inside a command, its shortcut.—
CommandStatus
A polite live region for loading and result counts. Its content is yours, usually a function of its state.—

Props

Prop

Type

View UI SDK parts and state attributes.