Documentation Index
Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Command is a keyboard-first command palette — typically opened with
⌘K — that allows users to search, navigate, and trigger actions without leaving the keyboard. It supports grouped results, icons, and keyboard shortcuts.
Installation
Usage
Variants
Inline (Embedded in Page)
UseCommand directly (without CommandDialog) to embed the palette inline — useful for search inputs, comboboxes, and filter panels.
Dialog (Global ⌘K Palette)
The most common pattern — full-screen overlay opened with a keyboard shortcut.API Reference
Command
Controlled selected item value.
Callback fired when the selected item changes.
Custom filter function. Return
1 to show, 0 to hide. Default: fuzzy search.Set to
false to disable built-in filtering (handle externally with async search).CommandDialog
Controlled open state.
Callback fired when open state changes.
CommandInput
Placeholder text shown when empty.
Controlled input value.
CommandItem
The value used for filtering and selection.
Callback fired when the item is selected (Enter or click).
Disables the item.
CommandGroup
Group label shown above the items.
Accessibility
CommandDialogusesrole="dialog"witharia-modal="true"CommandInputis a search input withrole="combobox"andaria-expandedCommandListhasrole="listbox"; eachCommandItemhasrole="option"- Keyboard: Arrow Up/Down navigates, Enter selects, Escape closes, typing filters
CommandEmptyis announced by screen readers when no results match
Do’s & Don’ts
Do
- Register
⌘K/Ctrl+Kglobally to open the command palette - Group items with
CommandGroupand clearheadinglabels - Show a visible keyboard shortcut hint in the UI (e.g. a button with
⌘Kbadge) - Use
shouldFilter={false}for server-side or async search
Don't
- Don’t put destructive actions in the command palette without confirmation
- Don’t list more than 20–30 items without grouping or filtering
- Don’t use Command as a regular dropdown — use
SelectorDropdownMenu - Don’t forget to close the dialog after an action is selected