Command
The inline command palette: a search field filtering a keyboard-navigable
list, built on Base UI Autocomplete in inline mode. The list is always open;
typing filters the entries and the first match is highlighted, so Enter
activates it.
Import from "@instruments/materia-ui/components/command".
Usage
Best practices
For a ⌘K overlay use
CommandDialog-Commandalone is the inline, non-floating palette container.Pass the entries as
items, or as titledgroups, and render them with a function child ofCommandList; filtering only sees those entries, so items written as static JSX are not filtered.Act on a choice with
CommandItem'sonClick, which fires for a pointer click and forEnteron the highlighted item.A plain click-triggered action menu is
DropdownMenu; a remembered selection isCombobox.
Props
Command
CommandDialog
CommandEmpty
CommandGroup
CommandInput
CommandItem
CommandList
CommandSeparator
Also exports
- const
commandAnatomy - component
CommandCollection - type
CommandDialogProps - interface
CommandGroupData - type
CommandProps - component
CommandShortcut - type
CommandSource