R

Combobox

16 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
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

Anchor

No props or events — renders its element and forwards attributes.

ComboboxArrow

Arrow

No props or events — renders its element and forwards attributes.

ComboboxCancel

Cancel

No props or events — renders its element and forwards attributes.

ComboboxContent

Content

No props or events — renders its element and forwards attributes.

ComboboxContentImpl

ContentImpl
PropTypeDescription
position?'inline' | 'popper'Position strategy.
disableOutsidePointerEvents?booleanBlock outside pointer events.

ComboboxEmpty

Empty
PropTypeDescription
always?booleanRender even when items exist but none are filtered out.

ComboboxGroup

Group

No props or events — renders its element and forwards attributes.

ComboboxInput

Input
PropTypeDescription
disabled?booleanDisable the input.
autoFocus?booleanFocus the input on mount.
openOnFocus?booleanOpen the combobox when the input is focused.
openOnClick?booleanOpen the combobox when the input is clicked.

ComboboxItem

Item
PropTypeDescription
valueTItem value. Selected/registered identity.
textValue?stringOptional explicit text for filter + typeahead.
disabled?booleanDisable this item.

ComboboxItemIndicator

ItemIndicator

No props or events — renders its element and forwards attributes.

ComboboxLabel

Label

No props or events — renders its element and forwards attributes.

ComboboxPortal

Portal

No props or events — renders its element and forwards attributes.

ComboboxRoot

Root
PropTypeDescription
modelValue?T | T[]Controlled selected value. Use `v-model`.
defaultValue?T | T[]Uncontrolled initial value.
defaultOpen?booleanUncontrolled default open state.
multiple?booleanAllow selecting multiple values.
dir?DirectionReading direction. Falls back to `ConfigProvider`.
disabled?booleanDisable the whole combobox.
required?booleanMark as required for native form validation.
name?stringNative input name for form submission.
resetSearchTermOnBlur?booleanReset the search term when the input is blurred.
resetSearchTermOnSelect?booleanReset the search term when a value is selected (single mode).
ignoreFilter?booleanSkip the built-in filter; render every item regardless of search term.
filterFunction?ComboboxFilterFunctionCustom filter implementation. Overrides the default substring match.
displayValue?(value: T | T[] | undefined) => stringMap 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

Separator

No props or events — renders its element and forwards attributes.

ComboboxTrigger

Trigger
PropTypeDescription
disabled?booleanDisable the trigger independently from the root.

ComboboxViewport

Viewport

No props or events — renders its element and forwards attributes.