Command

Cmd+K search: navigation, actions, recent items.
The search row is a real input: typing filters the grouped rows to the matching labels, and a query that matches nothing shows a muted "No results" row.
In glass mode the triggered palette is a functional-layer glass card under the search bar, with its own search field; the search editor keeps focus while typing filters the rows. Solid mode paints the skin's own palette.
The search placeholder names the input and its result list. Supply accessibilityLabel when a more specific purpose is needed. defaultActive={-1} starts without a highlighted result: Enter selects nothing until navigation or hovering chooses a row. Either arrow key starts at the first result from this state. Controlled indices above the visible result count clamp to the last match; negative, fractional and non-finite indices leave no active result.
Use filtered when a search service or index supplies ranked groups; Command keeps those rows and their order instead of filtering their labels again. An item's description supplies its secondary text. emptyMessage provides both the initial prompt and the no-match message.
Use embedded inside a Dialog or Drawer to inherit its surface and fill its bounds. It has no effect when trigger is set. Long results scroll within the palette. autoFocus focuses the inline field after the containing overlay captures its opener, so closing restores the original control. onKeyPress runs before built-in navigation; call preventDefault() to handle an application shortcut.
iOS
Android
Web
tsx
<Command
trigger
groups={[
{ heading: "Actions", items: [
{ label: "New File", icon: "file", shortcut: "Ctrl+N" },
{ label: "Open File", icon: "folder", shortcut: "Ctrl+O" },
{ label: "Save", icon: "save", shortcut: "Ctrl+S" }
] },
{ heading: "Navigation", items: [
{ label: "Go to Dashboard", icon: "arrowRight" },
{ label: "Go to Settings", icon: "arrowRight" }
] }
]}
/>

Props

Prop
Description
placeholder
string
Prompt shown in the empty search input.
accessibilityLabel
string
Accessible purpose for the search input and result list. Defaults to the search placeholder. Supply this when the placeholder does not explain the task.
query
string
The text typed into the search input (CONTROLLED). Filters the rows to the labels matching it (case-insensitive). Omit and use `defaultQuery` for uncontrolled use: a bare Command is searchable out of the box.
defaultQuery
string
Initial query for uncontrolled use.
onQueryChange
(query: string) => void
Fired with the new query on each keystroke (both modes).
groups
CommandGroup[]
Grouped result rows.
filtered
boolean
Groups are already filtered and ranked by the owner; preserve their order and contents.
embedded
boolean
Fill the parent and inherit its surface, for composition inside a Dialog or Drawer. Ignored with trigger.
autoFocus
boolean
Focus the inline search field after mounting, allowing the containing overlay to capture its opener first.
onKeyPress
TextInputProps["onKeyPress"]
Input keyboard handler, called before built-in navigation. preventDefault cancels built-in handling.
emptyMessage
string
Content shown when there are no result rows, including an empty query.
active
number
Flat index of the highlighted row (CONTROLLED), counted across the visible (query-matching) rows. Omit for uncontrolled use.
defaultActive
number
Initial highlighted row for uncontrolled use (hovering a row moves it, typing resets it to the first match).
open
boolean
Controlled open state. Omit for uncontrolled (the search trigger toggles it).
defaultOpen
boolean
Render the palette open initially for uncontrolled use (selecting a row closes it).
onOpenChange
(open: boolean) => void
Fired when the open state changes.
trigger
boolean
Render a collapsed full-width search trigger above the palette (a search glyph + "Search..." + a trailing kbd cap). The palette card still renders inline below the trigger (gated by `open`), mirroring how Dropdown shows its trigger plus the open menu in the docs.
footer
boolean
Append a footer hint bar below the list (↑ ↓ to navigate, ↵ to select, esc to close).
onSelect
(item: CommandItem, index: number) => void
Called with the chosen item and its flat index (within the visible, query-matching rows) when a row is pressed.
testID
string
E2E hook forwarded to the root element.
style
StyleProp<ViewStyle>
Outer layout composition only (width/flex within a parent), never a restyle hook.

Do & Don’t

Trigger

Don’t
Search...
A bare search button hides the keyboard shortcut, so power users never learn the ⌘K entry point.
Do
Surface the shortcut in a trailing kbd so the trigger advertises the faster keyboard path.

Inline

Don’t
New File
Ctrl+N
Save
Ctrl+S
Go to Dashboard
Go to Settings
Dumping every command into one flat list with no labels makes the palette hard to scan.
Do
Actions
New File
Ctrl+N
Save
Ctrl+S
Navigation
Go to Dashboard
Go to Settings
Group commands under labels with separators and highlight the first match so results stay scannable.