combobox

Combobox

Searchable single-choice list behind a trigger, with headed groups and an empty state; the list is as wide as its trigger, and the trigger joins a Field as its control.

Parts

PartFileDoes
ComboboxCombobox.vueGroups all parts of the combobox, which lets the user search and pick an option.
ComboboxAnchorComboboxAnchor.vueMarks where the option list attaches, wrapping the input and trigger.
ComboboxEmptyComboboxEmpty.vueShows a message when no option matches the search.
ComboboxGroupComboboxGroup.vueGroups related options in the combobox list.
ComboboxInputComboboxInput.vueLets the user type to filter the combobox options.
ComboboxItemComboboxItem.vueHolds one option the user can pick from the combobox.
ComboboxItemIndicatorComboboxItemIndicator.vueMarks an option as selected in the combobox list.
ComboboxListComboboxList.vueHolds the options the combobox offers while it is open.
ComboboxSeparatorComboboxSeparator.vueSeparates groups of options in the combobox list; hidden while a search filters the list.
ComboboxTriggerComboboxTrigger.vueShows the chosen option and opens the combobox list when pressed.
ComboboxViewportComboboxViewport.vueScrolls the options when the combobox list is longer than the space available.

Anatomy

<Combobox>
  <ComboboxAnchor>
    <ComboboxTrigger />
  </ComboboxAnchor>
  <ComboboxList>
    <ComboboxInput />
    <ComboboxViewport>
      <ComboboxEmpty />
      <ComboboxSeparator />
      <ComboboxGroup>
        <ComboboxItem>
          <ComboboxItemIndicator />
        </ComboboxItem>
      </ComboboxGroup>
    </ComboboxViewport>
  </ComboboxList>
</Combobox>

Styling

All of Combobox’s styles live in combobox.json. New to styling in Frontic UI? How styling works →

Install

npm packages
@lucide/vue
@vueuse/core
reka-ui

API reference

Combobox.vue

Groups all parts of the combobox, which lets the user search and pick an option.

Props 21

PropTypeDefault
openboolean—
defaultOpenbooleanfalse
resetSearchTermOnBlurbooleantrue
resetSearchTermOnSelectbooleantrue
openOnFocusbooleanfalse
openOnClickbooleanfalse
ignoreFilterbooleanfalse
resetModelValueOnClearbooleanfalse
unmountOnHidebooleantrue
multiplebooleanfalse
disabledbooleanfalse
dirDirection—
asChildbooleanfalse
asAsTag | Component—
modelValueAcceptableValue | AcceptableValue[]—
defaultValueAcceptableValue | AcceptableValue[]—
namestring—
requiredbooleanfalse
highlightOnHoverbooleantrue
loopbooleanfalse
bystring | ((a: AcceptableValue, b: AcceptableValue) => boolean)—

Events 3

EventPayload
update:modelValuevalue: AcceptableValue
update:openvalue: boolean
highlightpayload: { ref: HTMLElement; value: AcceptableValue; } | undefined

Slots 1

SlotSlot props
default{ open: boolean; modelValue: AcceptableValue | AcceptableValue[]; }

ComboboxAnchor.vue

ComboboxEmpty.vue

ComboboxGroup.vue

ComboboxInput.vue

ComboboxItem.vue

ComboboxItemIndicator.vue

ComboboxList.vue

ComboboxSeparator.vue

ComboboxTrigger.vue

ComboboxViewport.vue
Combobox
State