Components

Combobox

Input plus listbox selection with filtering and active-descendant navigation.

Combobox combines a text input with a role="listbox" popup. Users type to filter options, move through suggestions with the keyboard, and select from a known set. Use Select when no text input is needed.

Popup placement flips when preferred side lacks room, clamps to viewport, and follows anchor/content resize and ancestor scrolling.

Anatomy

  • #option: Custom selectable option row content.
  • #[option.slot]: Per-option render override.
  • #tag: Selected tag content in multiple mode.
  • #clear: Clear-button content.
  • #create: Creatable row content.
  • #group-label: Custom label row content.
  • #empty: Empty state when filtering returns no selectable options.
  • #loading: Loading state content.

The input, hidden form input, listbox, viewport, options, indicators, separators, and state attrs are generated by the component.

Usage

Value: vue

Examples

Bind v-model:search when search text must drive async loading or external filtering.

<script setup lang="ts">
const value = ref("");
const search = ref("");
</script>

<template>
  <Combobox v-model="value" v-model:search="search" :options="options" />
</template>

Multiple values

Set multiple and bind v-model to an array. clearable adds a clear control; selected values expose removable tags.

<template>
  <Combobox v-model="skills" multiple clearable :options="skillOptions" />
</template>

Custom filtering

Use filter when option search should use aliases, tags, or server-shaped data.

<template>
  <Combobox
    v-model="value"
    :options="options"
    :filter="(option, search) => String(option.keywords).includes(search)"
  />
</template>

Field integration

Place Combobox inside Field to inherit label metadata and form state.

<template>
  <Field label="Stack" name="stack" required>
    <Combobox v-model="stack" :options="options" />
  </Field>
</template>

Creatable options

Creation is app-controlled: Akaza emits requested text and your app decides whether and how to add it.

<Combobox
  v-model="framework"
  creatable
  :options="options"
  @create="value => options.push({ value, label: value })"
/>

Object values

Object values use identity by default. Supply isEqual when values are recreated and serializeValue when submitting them in a form.

<Combobox
  v-model="assignee"
  name="assignee"
  :options="people"
  :is-equal="(a, b) => a.id === b.id"
  :serialize-value="value => String(value.id)"
/>

Read-only and loading

readOnly preserves a visible value without allowing changes. loading exposes aria-busy and the loading slot for async sources.

<Combobox v-model="value" read-only :options="options" />
<Combobox v-model="value" loading :options="remoteOptions">
  <template #loading>Fetching teams…</template>
</Combobox>

API Reference

Props

PropTypeDefaultDescription
optionsComboboxOption[]requiredOptions rendered in the listbox.
valueKeystringObject key used as option value.
labelKeystring"label"Object key used as option label.
descriptionKeystring"description"Object key used as description.
disabledKeystring"disabled"Object key used as disabled state.
placeholderstringInput placeholder.
multiplebooleanfalseEnables multi-select.
nullableValuestring""Submitted empty value.
idstringfield idInput id.
namestringfield nameForm field name for hidden selected values.
requiredbooleanfalseRequired state.
disabledbooleanfalseDisables input and options.
readOnlybooleanfalseKeeps value readable but prevents opening, search, and selection changes.
invalidbooleanfalseSets invalid attrs.
loopbooleantrueArrow navigation wraps.
filterablebooleantrueEnables client filtering and aria-autocomplete="list".
filter(option, search) => booleanlabel contains searchCustom filter.
isEqual(a, b) => booleanObject.isValue comparator, useful for recreated object values.
serializeValue(value) => stringstring/JSONSerializes values for native form submission.
loadingbooleanfalseShows loading slot.
emptyLabelstring"No results found."Default empty text.
resetSearchOnBlurbooleanfalseClears search on blur.
resetSearchOnSelectbooleantrueClears search after selection.
openOnFocusbooleantrueOpens when input receives focus.
openOnClickbooleantrueOpens when input is clicked.
openOnInputbooleantrueOpens when search text changes.
clearablebooleanfalseRenders clear button when filled.
creatablebooleanfalseShows create row for unmatched search.
createLabel(search) => stringCreate “…”Formats default create row.
highlightOnHoverbooleantruePointer hover updates highlight.
side"top" | "bottom""bottom"Popup side.
align"start" | "center" | "end""start"Popup alignment.
sideOffsetnumber6Popup gap in pixels.
ariaLabelstringAccessible label.
ariaLabelledbystringAccessible label id.
ariaDescribedbystringfield description/errorDescription ids.
uiComboboxUiClasses for structural parts.

Emits

EventPayloadDescription
open-change(open, details)Fired before popup opens/closes.
value-change(value, details)Fired before selected value changes.
search-change(value, details)Fired before search text changes.
create(search, details)Requests creation of unmatched search text.

Slots

SlotPropsDescription
optionoption, value, label, description, isSelected, isHighlighted, isDisabled, selectCustom option row.
[option.slot]Same as optionPer-option renderer.
tagoption, value, removeSelected tag content.
clearClear-button content.
createsearch, createCreate-row content.
group-labeloption, labelCustom group label row.
emptyEmpty state.
loadingLoading state.

UI Options

KeyDescription
rootRoot wrapper.
inputText input / combobox trigger.
tagsMultiple-value tag container.
tagSelected tag.
tagLabelDefault tag label.
removeTag remove button.
clearClear-selection button.
hiddenInputHidden form input.
contentListbox popup.
viewportScrollable viewport.
emptyEmpty state.
loadingLoading state.
groupLabelLabel row.
separatorSeparator row.
optionOption row.
indicatorSelected indicator.
optionTextOption text wrapper.
optionLabelOption label.
optionDescriptionOption description.
createCreatable option row.

Styling Hooks

UI keyCSS classData attrs
rootakaza-comboboxdata-akaza-state, data-akaza-disabled, data-akaza-invalid, data-akaza-filled, data-akaza-focused
inputakaza-combobox-inputSame root attrs plus ARIA combobox attrs
tagsakaza-combobox-tags
tagakaza-combobox-tag
tagLabelakaza-combobox-tag-label
removeakaza-combobox-remove
clearakaza-combobox-clear
hiddenInputakaza-combobox-hidden-input
contentakaza-combobox-contentdata-akaza-state, data-akaza-side, data-akaza-align, --akaza-combobox-anchor-width, --akaza-combobox-anchor-height, --akaza-combobox-available-width, --akaza-combobox-available-height, --akaza-combobox-transform-origin, --akaza-combobox-duration
viewportakaza-combobox-viewport
emptyakaza-combobox-empty
loadingakaza-combobox-loading
groupLabelakaza-combobox-group-label
separatorakaza-combobox-separator
optionakaza-combobox-optiondata-akaza-state, data-akaza-highlighted, data-akaza-disabled, aria-disabled
indicatorakaza-combobox-indicator
optionTextakaza-combobox-option-text
optionLabelakaza-combobox-option-label
optionDescriptionakaza-combobox-option-description
createakaza-combobox-create

Popup entry and exit use a subtle side-aware structural transition. Override --akaza-combobox-duration to change its 120ms duration. Reduced-motion preference shortens it automatically.

Keyboard

KeyBehavior
ArrowDown / ArrowUpOpen popup and move highlight.
EnterSelect highlighted option or request creation for unmatched text.
Home / EndMove to first/last enabled visible option.
EscapeClose popup.