
Searchable dropdown for filtering and selecting from a list, built on Base UI Combobox.
npx shadcn@latest add https://ui.edbn.me/r/combobox.jsonGroups all parts of the combobox. Doesn't render its own HTML element.
defaultValueanyInitial selected value
valueanyControlled selected value
onValueChangefunctionCalled when value changes
defaultOpenbooleanfalseInitial open state
openbooleanControlled open state
onOpenChangefunctionCalled when popup opens/closes
defaultInputValuestring''Initial input value
inputValuestringControlled input value
onInputValueChangefunctionCalled when input value changes
disabledbooleanfalseDisable combobox
readOnlybooleanfalseRead-only state
requiredbooleanfalseRequired field
loopFocusbooleantrueLoop keyboard focus
The text input that filters the popup options list. Renders an input element.
autoSelectbooleanfalseAuto-select highlighted option on blur
filterOptionsfunction | nullOptions filter function
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-popup-open | Present when popup is open |
| data-disabled | Present when combobox is disabled |
| data-readonly | Present when combobox is read-only |
Moves the popup to a different part of the DOM. Renders a div element.
containerElement | nullPortal container
keepMountedbooleanfalseKeep in DOM when closed
Positions the popup against the input. Renders a div element.
side'top' | 'bottom' | 'left' | 'right''bottom'Side relative to anchor
sideOffsetnumber0Distance from anchor
align'start' | 'center' | 'end''start'Alignment relative to side
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-open | Present when popup is open |
| data-closed | Present when popup is closed |
| data-side | Side popup is positioned on |
| data-align | Alignment relative to side |
A container for the combobox options. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-open | Present when popup is open |
| data-closed | Present when popup is closed |
| data-starting-style | Present when animating in |
| data-ending-style | Present when animating out |
A scrollable list of items. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
An individual item in the combobox list. Renders a div element.
valueanyOption value
labelstringOption display label
disabledbooleanfalseDisable this option
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-highlighted | Present when option is highlighted |
| data-selected | Present when option is selected |
| data-disabled | Present when option is disabled |
Indicates whether the item is selected. Renders a span element.
keepMountedbooleanfalseKeep in DOM when not selected
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
Groups related options with a label. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
An accessible label for an option group. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
Shown when no items match the input. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function