Skip to content

Combobox

The Combobox component combines a text input with a dropdown selector, supporting keyword search filtering and keyboard navigation. Ideal for selecting from a large set of options.

Basic Usage

Bind the selected value via v-model and pass options via the options prop.

vue

<TCombobox v-model="value" :options="options" placeholder="Search..." />

Use the aliases field to add search keywords. Users can type Chinese names or common aliases to find matching options.

vue

<TCombobox v-model="value" :options="[
  { value: 'apple', label: 'Apple', aliases: ['苹果'] },
]" />

Size & Validation

Supports sm (small), lg (large) sizes and valid/invalid validation states.

Prepended / Appended Text

Use prepend-text and append-text to add fixed text before or after the input.

vue

<TCombobox prepend-text="$" append-text=".00" :options="options" />

API

Props

PropDescriptionTypeDefault
v-modelSelected valuestring''
optionsArray of optionsComboboxOption[][]
placeholderPlaceholder textstring'搜索...'
disabledDisable the inputbooleanfalse
requiredMark as requiredbooleanfalse
sizeInput size'sm' | 'lg'undefined
validationValidation state'valid' | 'invalid'undefined
blockFull widthbooleanfalse
prependTextPrepended textstringundefined
appendTextAppended textstringundefined

ComboboxOption

FieldDescriptionTypeDefault
valueOption valuestring— (required)
labelDisplay labelstring— (required)
aliasesSearch aliasesstring[]undefined

Slots

SlotScoped PropsDescription
option{ option, index, active, highlighted }Custom option rendering
prependPrepended content
appendAppended content