ComboboxPopover
Add combobox dropdown to any button element
Source
LLM docs
Docs
Package
Usage
ComboboxPopover adds a dropdown with selectable options to any button. Unlike Select
and MultiSelect, it does not render an input: pass your own target element to
ComboboxPopover.Target. The target must be a single element or component that accepts a ref.
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 add a search input to the dropdown:
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:
Multiple selection
Set multiple prop to allow selecting multiple values. value type changes
from string | null to string[].
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, onDropdownOpen and onDropdownClose props to control the dropdown state:
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.
Styles API
ComboboxPopover supports the Styles API; you can add styles to any inner element of the component with the classNames prop. Follow the Styles API documentation to learn more.
Component Styles API
Hover over selectors to highlight corresponding elements