Combobox

Searchable select input that filters a dropdown list of options as you type. Supports single and multiple selection with chips.

Setup

import { Combobox } from '@fragments-sdk/ui';

Examples

Default

Basic searchable select

Loading preview...

Multiple Selection

Multi-select with chips

Loading preview...

With Label and Helper Text

Combobox with built-in label and helper text

Loading preview...

Error State

Validation error with message

Loading preview...

With Groups

Options organized into groups

Loading preview...

With Empty State

Shows message when no results match

Loading preview...

Scrollable List

Long list with scroll hint — shows 4 items with half-peek of the 5th

Loading preview...

Custom Max Visible Items

Show 6 items before scrolling with half-peek scroll hint

Loading preview...

Disabled

Disabled combobox

Loading preview...

Explicit Trigger

Hide the built-in input trigger when rendering a separate Combobox.Trigger

Loading preview...

Props

PropTypeDefaultDescription
multiplebooleanfalseAllow multiple selections with chips
valueunionNot setControlled selected value (string for single, string[] for multiple)
defaultValueunionNot setDefault selected value (uncontrolled)
onValueChangeunionNot setCalled when selection changes
onChangeunionNot setAlias for onValueChange
childrenRequirednodeNot setCombobox input and content
openbooleanNot setControlled open state of the dropdown
defaultOpenbooleanfalseInitial open state for uncontrolled usage
onOpenChangefunctionNot setCalled when dropdown open state changes
requiredbooleanNot set
namestringNot set
placeholderstringNot setPlaceholder text for the input
autoHighlightbooleantrueAuto-highlight first matching item while filtering
sizeenumsmmdlgmdSize variant
classNamestringNot setWrapper class name
labelstringNot setVisible label text above the combobox
helperTextstringNot setHelper text shown below the combobox
errorunionNot setShow error styling. When a string is provided, it is displayed as an error message.
disabledbooleanfalseDisable the combobox

Usage Guidelines

When to use

  • Users need to search/filter through many options
  • Large option lists where scrolling is impractical
  • When users might know what they are looking for
  • Autocomplete or typeahead functionality
  • Multiple selections from a searchable list

When not to use

  • Few options (under 5) - use Select or RadioGroup
  • Free-form text with no predefined options - use Input
  • Non-searchable single selection - use Select
  • Actions, not selection - use Menu

Best practices

  • Include a placeholder that explains what to search for
  • Use label prop for accessible field labeling
  • Use helperText for guidance and error for validation messages
  • Provide an empty state message when no results match
  • Group related options with Combobox.Group for large lists
  • Keep option text concise and searchable
  • Use multiple prop for multi-select with chip display
Accessibility
  • Full keyboard navigation support (arrow keys, enter, escape)
  • Type-ahead filtering within options
  • Proper ARIA combobox roles and attributes
  • Screen reader announcements for filtered results
  • Chip removal via keyboard in multi-select mode