Search field for long option lists on cmdk and Radix Popover: the list unrolls from the field, a pill tracks the highlight and the chosen text rolls up into the field.
Use to pick one option from a long list by typing; the list filters as people type. Presets: field, toolbar and rich (two-line rows). Works with server-side search, a loading state and a Create row.
When not to use
For fewer than about seven options use Segmented Control or a plain select. For several values at once use Tag Input.
Use it to pick one option from a long list that people search by typing: a billing country, an owner, a product, an account. The field is the input; the list filters as they type and the choice is a single value. For fewer than about seven options, use a select or a segmented control; for several values at once, use a multi-select; for commands rather than values, use a command palette.
The motion follows the three beats. Pressing the field charges: it sinks and the chevron turns a quarter. The list then acts: one opaque panel unrolls from the field, starting one whole row tall, its top edge staying under the input while the height grows, and the rows cascade in. It settles as a pill under the highlighted row, which stretches when the highlight jumps several rows. Typing filters by reflow: surviving rows slide to their new place and the others fade. On select the panel rolls back up into the field, fully opaque until it is gone (no fade over the form below), while the chosen text rolls in from below. calm shortens and quiets all of this, playful moves more.
Controlled, with value and onValueChange (null means nothing is selected). inputValue / onInputValueChange control the query; set shouldFilter={false} and use them for server-side search, with loading while a request runs. Add clearable for a clear button, error for a message under the field, and displayValue when the selected option is not mounted yet.
Pick a layout with preset (field, toolbar, rich) and a height with size (sm, md, lg). The motion is the same in every preset. Set the character app-wide with MotionKitProvider, or per field:
Group rows with ComboboxGroup heading, add a ComboboxSeparator, give options keywords (aliases, codes) and, in rich, a description and a leading ball. ComboboxEmpty takes onCreate to add a "Create" row under the message.
The toolbar preset is a compact "Owner: Any" button for filter bars above a table. The panel widens from the trigger and carries its own search input; on select the chosen text rolls into the button.
The rich preset shows two-line rows grouped by team, each with a leading ball, a name and a role. The demo searches asynchronously, with loading while it waits, and offers onCreate when nothing matches.
In field and rich, the input is role="combobox" with aria-expanded, aria-controls, aria-activedescendant, aria-autocomplete="list" and aria-haspopup="listbox". The highlight moves by aria-activedescendant, so focus never leaves the input. Name it with aria-label or a <label htmlFor>.
In toolbar, the trigger is a button with aria-haspopup="dialog"; the panel is a dialog named by the trigger's label and holds a search combobox named "Search label".
The list is a listbox, named by the label prop of ComboboxList, with aria-busy while loading. error sets aria-invalid and describes the field.
The result count is announced through a polite live region once typing pauses (0.4 s), so fast typing produces one message.
The pill, chevron, icons, leading balls and loading placeholders are aria-hidden. The clear button is named "Clear selection".
Rows are at least 28 px tall. Text uses foreground and muted-foreground and the chosen row carries a check, so selection is not shown by color alone; contrast holds in light and dark.
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") there is no sink, no chevron turn and no unrolling. The panel crossfades in below the field, the rows fade in together, the highlight pill glides without stretching and the chosen text crossfades into the field, all in the 120 ms fade. The list, the filtering and every key work the same.
The panel animates height (and width in toolbar) on a spring while it unrolls; rows animate with transform and opacity. Nothing re-renders per frame: the pill and aria-activedescendant follow the highlight without re-rendering the rows.
Nothing runs at rest, so there is no loop to pause off-screen or in a hidden tab; the loading spinner only runs while loading and the field is visible.
The panel renders in a portal only while open. Heavy lists can be filtered on the server with shouldFilter={false}.
Our code is about 12.6 kB gzip: the component plus the shared MotionKit helpers it installs (10.2 kB for the component file alone).
Third-party dependencies, measured apart (gzip, React excluded): cmdk 4.6 kB of its own code, @radix-ui/react-popover 24.3 kB with the Radix primitives it pulls (cmdk and the popover together 32.4 kB, shared primitives counted once), and the motion features used 42.5 kB. Most shadcn projects with MotionKit already ship all three.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-popover, motion.
Dependencies
@radix-ui/react-popover · peer
cmdk
motion · peer
Triggers
click, typing, press, keyboard focus
Reduced motion
No sink, chevron turn or unrolling: the panel crossfades in place below the field, rows fade in together, the highlight pill glides without stretching and the chosen text crossfades into the field, all in the 120ms fade.
Keyboard
Typing
Opens the list and filters it; surviving rows slide into place
ArrowDown / ArrowUp
Opens the list on the chosen row; when open, moves the highlight one row
Alt + ArrowUp / ArrowDown
Jumps between groups while the list is open
Home / End
First / last row while the list is open
PageDown / PageUp
Moves the highlight 10 rows; the pill stretches over the jump
Ctrl + N / Ctrl + P (J / K)
Next / previous row
Enter
Selects the highlighted row and closes; the text rides up into the field
Escape
Closes the list; a second Escape clears the query
Tab / Shift + Tab
Closes without selecting and moves focus
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)