ComboboxPopover
Add combobox dropdown to any button element
Source
LLM docs
Docs
Package
Usage
ComboboxPopover allows adding a combobox dropdown with selectable options to any button element.
Unlike Select and MultiSelect, it does not render an input – instead, you provide your own
target element (typically a Button) via ComboboxPopover.Target.
ComboboxPopover.Target child must be a single element or component that accepts a ref.
Fragments, strings, and other primitive values are not supported.
Data format
ComboboxPopover supports the same data format as Select component:
an array of strings, objects with value and label, or grouped items.
Data formats
ComboboxPopover data prop accepts data in one of the following formats:
Array of primitive values (strings, numbers, booleans):
Array of objects with value, label and optional disabled keys:
Array of groups with primitive value (string, number, boolean) options:
Array of groups with object options:
Searchable
Set searchable prop to enable a search input inside the dropdown that filters options as you type.
Use nothingFoundMessage to display a message when no options match the search query.
Controlled search value
Use searchValue and onSearchChange props to control the search input value:
Search value: (empty)
Selected value: (none)
Sort options
Use filter prop with searchable to provide a custom filtering and sorting function:
Limit options
Use limit prop with searchable to limit the number of options displayed at a time.
This is useful for large data sets to improve performance:
Multiple selection
Set multiple prop to allow selecting multiple values. When multiple is set,
value type changes from string | null to string[], and onChange callback
receives an array of selected values.
Check icon
Allow deselect
By default, the selected option can be deselected by clicking it again.
Set allowDeselect={false} to prevent this behavior.
Nothing found message
Set nothingFoundMessage prop to display a message when no options are available:
Disabled options
Groups
Render option
Use renderOption prop to customize option rendering:
Large data sets
By default, the dropdown is wrapped with ScrollArea.Autosize.
Use maxDropdownHeight to control the maximum height:
Control dropdown opened state
Use dropdownOpened prop to control the dropdown state.
Additionally, you can use onDropdownOpen and onDropdownClose callbacks
to react to dropdown state changes.
Dropdown position
Dropdown width
By default, the dropdown width matches the target element. Use comboboxProps
to set a custom width:
Dropdown animation
Form submission
ComboboxPopover renders a hidden input with the selected value for native form submission.
Use name prop to set the input name. For multiple selection, values are joined with a comma
by default – use hiddenInputValuesDivider to change the separator.