Combobox
A searchable dropdown that combines select functionality with powerful filtering. Perfect for finding options in large lists, building command palettes, or when users need quick access through search.View source →This component's API and documentation are under review and may change. Use with caution in production.
A searchable dropdown that combines select functionality with powerful filtering. Perfect for finding options in large lists, building command palettes, or when users need quick access through search.
Built on top of cmdk for search and filtering, and Radix Popover for positioning and focus management.
Playground
Installation
shellUsage
tsxAnatomy
Combobox is a compound component with the following parts:
tsxRoot Props
The Root component manages state and provides context to all child components.
Trigger Props
The Trigger component renders as a button that opens the dropdown.
Trigger also supports all margin props (m, mx, my, mt, mr, mb, ml) with responsive values.
Content Props
The Content component renders the dropdown surface containing the search input and options list.
Input Props
The Input component renders the search field inside Content.
Other Components
Combobox.Value- Displays selected option label or placeholder in triggerCombobox.List- Container for items with ScrollArea supportCombobox.Item- Selectable option. RequiresvaluepropCombobox.Group- Groups related items togetherCombobox.Label- Non-interactive label for groupsCombobox.Separator- Visual separator between items or groupsCombobox.Empty- Shown when no results match search. Only visible when filtering produces zero matches
Trigger Variants
Classic
Elevated style with subtle shadow for maximum visual impact.
tsxSurface
Elevated surface style for standard form fields.
tsxSoft
Subtle background for secondary selections.
tsxOutline
Bordered style for clear field boundaries.
tsxGhost
Minimal style for utility controls.
tsxContent Variants
Solid
Default opaque background for standard dropdowns with clear separation from the page.
tsxSoft
Subtle background for content-heavy interfaces where less visual weight is desired.
tsxSizes
Set size on Root to control density across the entire combobox. Affects trigger height, content padding, and item spacing.
tsxColors
Use the color prop on Root to set semantic colors for the trigger and selected items. Use highContrast for maximum visibility on complex backgrounds.
tsxStates
Loading
Set loading on Trigger to show a spinner during async operations like fetching options.
tsxDisabled
Set disabled on Root to prevent all interaction with the combobox.
tsxError
Use error on Trigger to indicate validation failures.
tsxRead Only
Use readOnly on Trigger to show the selected value without allowing changes.
tsxGroups and Labels
Organize options with groups and labels for better scannability in large lists.
tsxControlled State
Control the selection and search values for full state management.
tsxDisplay Value
Use the displayValue prop on Root for best performance when you have access to the selected item's label from your data source. This avoids needing to mount all items just to register their labels.
tsxCustom Filtering
Disable Built-in Filtering
For async or server-side search, disable the built-in filtering and manage options yourself.
tsxCustom Filter Function
Provide custom ranking logic for more control over search results.
tsxEmpty State
Use Combobox.Empty to provide helpful feedback when no results match the search.
tsxInput Adornments
Add icons or elements before or after the search input for better visual context.
tsxResponsive
Use responsive objects with size on Root to adapt sizing across different breakpoints.
tsxMaterial
Use the material prop on Trigger to control background appearance. Choose solid for opaque backgrounds, or translucent for depth over images or dynamic backgrounds.
tsxAccessibility
Combobox implements the WAI-ARIA 1.2 combobox pattern with comprehensive keyboard support.
Keyboard Navigation
- Space/Enter - Open dropdown when trigger is focused
- Type - Filter options in real-time
- Arrow Down/Up - Navigate through options
- Home/End - Jump to first/last option
- Enter - Select highlighted option and close
- Escape - Close dropdown without selecting
- Tab - Close dropdown and move focus to next element
ARIA Attributes
role="combobox"- Identifies the trigger as a comboboxaria-expanded- Announces dropdown state (open/closed)aria-haspopup="listbox"- Indicates dropdown contains a listboxaria-controls- Links trigger to listbox when openaria-activedescendant- Announces currently highlighted optionaria-autocomplete="list"- Indicates filtering behavioraria-disabled- Announces disabled state
Screen Readers
- Selection changes are announced automatically
- Search results update live as user types
- Empty state is announced when no matches found
- Loading state communicated through spinner
Focus Management
- Input automatically receives focus when dropdown opens
- Focus returns to trigger when dropdown closes
- Keyboard navigation maintains visual highlight
Changelog
Added
- Initial Combobox component with search and filtering
- Built on cmdk for fuzzy search and keyboard navigation
- Trigger variants: classic, surface, soft, outline, ghost
- Content variants: solid, soft
- Three sizes (1, 2, 3) with responsive support
- Custom filter function support via
filterprop displayValueprop for optimal performance with large lists- Groups, labels, and separators for organization
- Empty state component for no-results feedback
- Loading, error, disabled, and read-only states
- Input adornments (startAdornment, endAdornment)
- Full controlled state support (value, searchValue, open)
resetSearchOnSelectoption to control search clearing- Color and highContrast props for semantic styling
- Material prop for translucent effects
- Margin props with responsive support
- RTL (Right-to-Left) layout support
- Windows High Contrast mode support
- Reduced motion support for animations
Fixed
- Label registration system for displaying selected value
- Performance optimization with lazy mounting (forceMount control)
- ARIA attributes for WAI-ARIA 1.2 combobox pattern
- Focus management when opening/closing dropdown
- Search value synchronization with controlled state