Combobox
16 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
import {
ComboboxAnchor,
ComboboxArrow,
ComboboxCancel,
ComboboxContent,
ComboboxContentImpl,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxItemIndicator,
ComboboxLabel,
ComboboxPortal,
ComboboxRoot,
ComboboxSeparator,
ComboboxTrigger,
ComboboxViewport,
} from '@robonen/primitives/combobox';
<ComboboxAnchor>
<ComboboxArrow />
<ComboboxCancel />
<ComboboxContent />
<ComboboxContentImpl />
<ComboboxEmpty />
<ComboboxGroup />
<ComboboxInput />
<ComboboxItem />
<ComboboxItemIndicator />
<ComboboxLabel />
<ComboboxPortal />
<ComboboxRoot />
<ComboboxSeparator />
<ComboboxTrigger />
<ComboboxViewport />
</ComboboxAnchor>API Reference
ComboboxAnchor
AnchorNo props or events — renders its element and forwards attributes.
ComboboxArrow
ArrowNo props or events — renders its element and forwards attributes.
ComboboxCancel
CancelNo props or events — renders its element and forwards attributes.
ComboboxContent
ContentNo props or events — renders its element and forwards attributes.
ComboboxContentImpl
ContentImpl| Prop | Type | Description |
|---|---|---|
position? | 'inline' | 'popper' | Position strategy. |
disableOutsidePointerEvents? | boolean | Block outside pointer events. |
ComboboxEmpty
Empty| Prop | Type | Description |
|---|---|---|
always? | boolean | Render even when items exist but none are filtered out. |
ComboboxGroup
GroupNo props or events — renders its element and forwards attributes.
ComboboxInput
Input| Prop | Type | Description |
|---|---|---|
disabled? | boolean | Disable the input. |
autoFocus? | boolean | Focus the input on mount. |
openOnFocus? | boolean | Open the combobox when the input is focused. |
openOnClick? | boolean | Open the combobox when the input is clicked. |
ComboboxItem
Item| Prop | Type | Description |
|---|---|---|
value | T | Item value. Selected/registered identity. |
textValue? | string | Optional explicit text for filter + typeahead. |
disabled? | boolean | Disable this item. |
ComboboxItemIndicator
ItemIndicatorNo props or events — renders its element and forwards attributes.
ComboboxLabel
LabelNo props or events — renders its element and forwards attributes.
ComboboxPortal
PortalNo props or events — renders its element and forwards attributes.
ComboboxRoot
Root| Prop | Type | Description |
|---|---|---|
modelValue? | T | T[] | Controlled selected value. Use `v-model`. |
defaultValue? | T | T[] | Uncontrolled initial value. |
defaultOpen? | boolean | Uncontrolled default open state. |
multiple? | boolean | Allow selecting multiple values. |
dir? | Direction | Reading direction. Falls back to `ConfigProvider`. |
disabled? | boolean | Disable the whole combobox. |
required? | boolean | Mark as required for native form validation. |
name? | string | Native input name for form submission. |
resetSearchTermOnBlur? | boolean | Reset the search term when the input is blurred. |
resetSearchTermOnSelect? | boolean | Reset the search term when a value is selected (single mode). |
ignoreFilter? | boolean | Skip the built-in filter; render every item regardless of search term. |
filterFunction? | ComboboxFilterFunction | Custom filter implementation. Overrides the default substring match. |
displayValue? | (value: T | T[] | undefined) => string | Map the current model value to the input's display value. |
by? | string | ((a: T, b: T) => boolean) | Compare values by key, or via a custom comparator. |
ComboboxSeparator
SeparatorNo props or events — renders its element and forwards attributes.
ComboboxTrigger
Trigger| Prop | Type | Description |
|---|---|---|
disabled? | boolean | Disable the trigger independently from the root. |
ComboboxViewport
ViewportNo props or events — renders its element and forwards attributes.