Commandv0.1.8Documentation Under Review
A fast, composable command menu component for keyboard-driven navigation and search, built on cmdk primitives.
Prefer AI-assisted development?
Catalyst Command wraps cmdk primitives with design tokens and accessible defaults — giving you a production-ready command palette with fuzzy search and full keyboard navigation out of the box.
Installation
npm install @pmi/catalyst-commandimport {
CommandRoot,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandItem,
CommandSeparator,
} from '@pmi/catalyst-command';Common Patterns
In a Dialog
Embed the command menu inside a Dialog to create a modal command palette triggered by a button or keyboard shortcut.
API Reference
Command is a compound component built on cmdk primitives. The sections below highlight consumer-facing props for the most commonly configured parts of the component.
CommandRoot
The root container that manages command state and search. Accepts all standard cmdk Command props and forwards ref.
Prop
Type
CommandInput
Search input for filtering command items. Accepts all standard cmdk Input props and forwards ref.
Prop
Type
CommandList
Scrollable container for command groups and items. Accepts all standard cmdk List props and forwards ref.
Defaults to max-h-[300px] with overflow scroll.
CommandEmpty
Message displayed when no items match the current search. Accepts all standard cmdk Empty props and forwards ref.
CommandGroup
Groups related items with an optional heading. Accepts all standard cmdk Group props and forwards ref.
Prop
Type
CommandItem
Individual selectable command item. Accepts all standard cmdk Item props and forwards ref.
Prop
Type
Data attributes: data-selected="true" when the item is highlighted; data-disabled="true" when disabled.
CommandSeparator
Visual divider between command groups. Accepts all standard cmdk Separator props and forwards ref.
Accessibility
Keyboard Interactions
| Key | Action |
|---|---|
↑ / ↓ | Navigate through items |
Enter | Select the highlighted item |
Escape | Close the command menu (when inside a dialog) |
| Type | Filter items in real time |
ARIA
- Implements the ARIA combobox pattern via cmdk.
aria-expandedreflects list expansion state;aria-activedescendanttracks the focused item.- Search results are announced via live regions.
- Group headings are properly associated with their items via
aria-labelledby. - Catalyst provides the visual styling; cmdk handles the underlying accessibility semantics.
See the cmdk documentation for inherited baseline behavior.
Choosing the Right Component
Use Command when you need a searchable, keyboard-driven action menu. Reach for a different primitive when:
| If you need… | Use instead |
|---|---|
| A simple dropdown list | Select |
| A contextual action menu | DropdownMenu |
| A standalone text input | Input |
Related
Link
An accessible anchor component with configurable underline behavior, text wrapping, disabled state, and polymorphic rendering via asChild. Built on standard HTML with Catalyst design tokens.
Kbd
Display keyboard shortcuts and key combinations with semantic styling. Built on the native HTML kbd element with CVA variants for size, danger state, and decorative vs. text rendering.