GitHubopen_in_new

Combobox ​

Combobox combines free-form text entry with option picking, making it useful for searchable single- and multi-select flows.

Combobox shares Select's size and menu-color preferences; see Select for sizes and Menu Appearance for colors. Its labelClearance prop inherits from fieldContextKey. Preserve the surrounding layout's intended density and add clearance only when its floating label needs it. See the field layout guide.

Props

NameDescriptionDefaultControl
shapeOptional

Corner style; inherits the shared shape default.

M3Shape | undefined
-
-
sizeOptional

The trigger height. Matches the 32px, 40px, and 56px TextField and Button sizes.

TextFieldSize | undefined
-
-
disabledOptional

Whether the control is disabled.

boolean | undefined
-
nameOptional

Name used for hidden inputs during form submission.

string | undefined
-
multipleOptional

Enables multi-select behavior.

boolean | undefined
-
-
labelOptional

Floating label, or accessible-name fallback in external mode. Otherwise supply an external label or ARIA name.

string | undefined
-
labelBehaviorOptional

Floating label or externally arranged visible label; label remains an accessible-name fallback.

FieldLabelBehavior | undefined
-
-
idOptional

Optional explicit id for the trigger element.

string | undefined
-
optionsRequired

Selectable options rendered in the menu.

SelectOption[]
-
-
filterModeOptional

Consumer-owned search results bypass local filtering.

localexternal
-
resolveLabelOptional

Resolve selected values absent from current results; reactive caches are supported.

((value: SelectOptionValue) => string | undefined) | undefined
-
supportingTextOptional

Supporting text shown below the field when not in error state.

string | undefined
-
errorOptional

Error text shown below the field. When provided, field is invalid.

string | undefined
-
requiredOptional

Whether the control is required.

boolean | undefined
-
placeholderOptional

Placeholder shown when nothing is selected.

string | undefined
-
labelClearanceOptional

CSS length reserved at block-start for the floating label. Overrides FieldContext.

string | undefined
-
showSelectedIconOptional

Show selected checkmarks; inherits Select defaults, then falls back to true.

boolean | undefined
undefined
clearableOptional

Shows a trailing button that clears the current selection.

boolean | undefined
-
clearLabelOptional

Accessible label for the clear button.

string | undefined
-
menuColorOptional

Visual color style of the dropdown menu.

MenuColor | undefined
-
-
displaySeparatorOptional

Separator used when showing multiple selected labels.

string | undefined
-
filterPlaceholderOptional

Placeholder shown in the field while filtering.

string | undefined
-
filterNoResultsTextOptional

Message shown when filtering returns no matching options.

string | undefined
-
modelValueOptional

-

SelectModelValue
-
-
queryOptional

-

string | undefined
""
openOptional

-

boolean | undefined
false

Events7

NameTypeDescription
update:open[value: boolean]-
closed[]-
update:modelValue[value: SelectModelValue]-
update:query[value: string]-
change[value: SelectModelValue]-
focus[event: FocusEvent]-
blur[event: FocusEvent]-

Slots7

NameParametersDescription
list--
leading--
prefix--
suffix--
trailing--
optionLeading--
optionTrailing--

Combobox forwards Select's closed event after its dropdown menu finishes exiting. Use it instead of update:open(false) when releasing data used by option slots.

INFO

Combobox wraps Select and shares its select scope. See Select Anatomy.

showSelectedIcon and selectDefaults are shared with Select; see selected checkmarks.

Labels follow the shared fieldLabelBehavior default (floating, or external in compact). Override it with label-behavior. External mode omits the visible label and notch, ignores labelClearance, and uses label only as an accessible-name fallback. See Field layout for custom label layouts.

Combobox forwards list, v-model:query, filterMode, and resolveLabel to Select. Use the same SelectItem composition for virtual rows; filtering and navigation operate on the complete logical result set while focus stays in the input. See external virtual lists and selected label resolution.

Examples ​

Default ​

Multiple Selection ​

Composable ​

Combobox shares the same composable as Select.

useSelect ​

Full type signaturefunction useSelect(opts: UseSelectOptions): { filterQuery: import("vue").Ref<string, string>; selectedOptions: import("vue").ComputedRef<UseSelectOption[]>; hasValue: import("vue").ComputedRef<boolean>; displayText: import("vue").ComputedRef<string>; submittedValues: import("vue").ComputedRef<string[]>; filteredOptionEntries: import("vue").ComputedRef<import("./selectModel").SelectOptionEntry[]>; hasFilteredOptions: import("vue").ComputedRef<boolean>; activeIndex: import("vue").ComputedRef<number>; activeDescendant: import("vue").ComputedRef<string | undefined>; list: import("vue").ComputedRef<{ entries: import("./selectModel").SelectOptionEntry[]; scrollElement: HTMLElement | undefined; activeIndex: number; open: boolean; setScrollToIndex: (callback: ((index: number) => void) | undefined) => void; }>; optionProps: (index: number, option: UseSelectOption) => { id: string; 'aria-posinset': number; 'aria-setsize': number; 'data-active': string | undefined; 'data-keyboard-active': string | undefined; 'data-first': string | undefined; 'data-last': string | undefined; ref: (instance: Element | ComponentPublicInstance | null) => void; onMousedown: (event: MouseEvent) => void; onPointermove: () => void; onClick: () => void; }; isOptionSelected: (option: UseSelectOption) => boolean; toggleOption: (option: UseSelectOption) => void; clearValue: () => void; focus: () => void; blur: () => void; show: () => Promise<void>; hide: () => void; toggle: () => void; openMenu: (target?: "first" | "last") => void; closeMenu: () => void; handleFieldClick: () => void; handleFieldInput: () => void; handleFilterKeydown: (event: KeyboardEvent) => void; handleMenuClosed: () => void; }

Source: src/composables/useSelect.ts

FieldTypeRequiredDescriptionDefault
options() => UseSelectOption[]YesUnique, stable values identify the complete logical result set.-
multiple() => booleanYes--
filterable() => booleanYes--
disabled() => booleanYes--
displaySeparator() => stringYes--
locale(() => string | undefined) | undefinedNo--
filterMode(() => "local" | "external") | undefinedNoDisable local filtering when the consumer supplies search results.-
resolveLabel((value: UseSelectOptionValue) => string | undefined) | undefinedNoResolve values missing from current results. Falls back to String(value).-
queryRef<string, string> | undefinedNo--
modelValueRef<UseSelectModelValue, UseSelectModelValue>Yes--
openRef<boolean, boolean>Yes--
onChange((value: UseSelectModelValue) => void) | undefinedNo--
onClosed(() => void) | undefinedNo--
id() => stringYesStable listbox id, normally derived from useId().-
focus() => voidYes--
blur() => voidYes--
showMenu() => voidYesUse the shared Menu overlay, including source anchoring and close completion.-
hideMenu() => voidYes--
scrollElement() => HTMLElement | undefinedYesThe MenuContainer is the single scroll owner.-
FieldTypeRequiredDescriptionDefault
filterQueryimport("vue").Ref<string, string>Yes--
selectedOptionsimport("vue").ComputedRef<UseSelectOption[]>Yes--
hasValueimport("vue").ComputedRef<boolean>Yes--
displayTextimport("vue").ComputedRef<string>Yes--
submittedValuesimport("vue").ComputedRef<string[]>Yes--
filteredOptionEntriesimport("vue").ComputedRef<import("./selectModel").SelectOptionEntry[]>Yes--
hasFilteredOptionsimport("vue").ComputedRef<boolean>Yes--
activeIndeximport("vue").ComputedRef<number>Yes--
activeDescendantimport("vue").ComputedRef<string | undefined>Yes--
listimport("vue").ComputedRef<{ entries: import("./selectModel").SelectOptionEntry[]; scrollElement: HTMLElement | undefined; activeIndex: number; open: boolean; setScrollToIndex: (callback: ((index: number) => void) | undefined) => void; }>Yes--
optionProps(index: number, option: UseSelectOption) => { id: string; 'aria-posinset': number; 'aria-setsize': number; 'data-active': string | undefined; 'data-keyboard-active': string | undefined; 'data-first': string | undefined; 'data-last': string | undefined; ref: (instance: Element | ComponentPublicInstance | null) => void; onMousedown: (event: MouseEvent) => void; onPointermove: () => void; onClick: () => void; }Yes--
isOptionSelected(option: UseSelectOption) => booleanYes--
toggleOption(option: UseSelectOption) => voidYes--
clearValue() => voidYes--
focus() => voidYes--
blur() => voidYes--
show() => Promise<void>Yes--
hide() => voidYes--
toggle() => voidYes--
openMenu(target?: "first" | "last") => voidYes--
closeMenu() => voidYes--
handleFieldClick() => voidYes--
handleFieldInput() => voidYes--
handleFilterKeydown(event: KeyboardEvent) => voidYes--
handleMenuClosed() => voidYes--