UIIcons

Command

A command palette for fast keyboard-driven navigation and action execution.

Installation

pnpm dlx stera-ui@latest add command

Composition

Use the following composition to build a Command:

Command
├── CommandInput
└── CommandList
    ├── CommandEmpty
    ├── CommandGroup
    │   ├── CommandItem
    │   └── CommandItem
    ├── CommandSeparator
    └── CommandGroup
        ├── CommandItem
        └── CommandItem

Examples

Command Dialog

Use CommandDialog and CommandDialogTrigger to open the command palette in a modal overlay.

Title & Description

Use CommandItemContent, CommandItemTitle, and CommandItemDescription for richer item layouts.

API Reference

CommandItem

PropTypeDefault
disabledbooleanfalse

CommandGroup

PropTypeDescription
headingstringSection label shown above the group

Subcomponents

ComponentDescription
CommandInputSearch/filter text input
CommandListScrollable list container
CommandEmptyShown when no items match the query
CommandSeparatorHorizontal divider between groups
CommandShortcutRight-aligned keyboard shortcut label
CommandItemContentColumn container for title + description
CommandItemTitlePrimary text inside CommandItemContent
CommandItemDescriptionSecondary text inside CommandItemContent
CommandDialogModal wrapper for the command palette
CommandDialogTriggerTrigger that opens the CommandDialog