Forms
Autocomplete
A text input that filters and selects from a list of suggestions as you type.
<UiAutocomplete :items="..." />Items
requireditems is the list of suggestions, filtered as you type. A bare string or number is the shorthand for an option whose label and value match; the long form is { label, value } with an optional icon and disabled. { type: 'label' } and { type: 'divider' } entries group a long list. Unlike Combobox, the trigger here *is* the text field, so what you type filters in place rather than in a separate search box.
Functionally close to Combobox, but the trigger itself is a free-typing text input (not just a filter box inside a popup) — useful when the typed text should also be a valid value, not just a filter.
Model value
modelValue is the selected value — the option's value, not the text currently typed, and an array once multiple is set. Pass it to control the selection yourself; the typed query is the component's own business and isn't exposed through this model.
Default value
defaultValue is what's selected on first render while the field still owns its own state — a sensible starting suggestion you don't otherwise need to hold onto.
Multiple
multiple lets more than one option be selected at once, and turns the selected set into removable tags inside the field. Each tag carries its own remove button; an item can still opt out of selection entirely with its own disabled flag.
Placeholder
placeholder is the hint in the field while nothing has been typed or selected. Say that typing filters — “Search a country” rather than “Country” — since this input behaves unlike the plain text fields around it.
Icon
icon sits at the start of the field while nothing is selected; an option carrying its own icon replaces it once chosen. It's a way to say what the field searches without spending a label on it.
Disabled
disabled locks the whole input — the field stops accepting text and the dropdown stops opening. It's separate from a per-item disabled, which greys out one option while leaving the rest usable.
Clearable
clearable shows a button to clear the current selection.
Variant
variant picks between the ringed outline field on the page background and the filled, ringless soft one, which has its own section below.
Content
content positions the dropdown relative to the field: which side it opens on, how it aligns to the trigger, and how far off it sits.
Open
open controls whether the suggestion list is showing. Pass it to drive the list from your own state and bind it with v-model:open so typing still opens it; omit it and the component manages that itself.
Default open
defaultOpen starts the suggestion list expanded on mount while leaving the open state uncontrolled — a way to show what's on offer before anyone types, at the cost of covering whatever sits below.
`variant="soft"`
A filled, tinted background with no ring.
Wrapped in `FormField`
API Reference
Generated from the component's source — props, slots and emits as the component actually declares them.
Props
itemsrequiredAutocompleteItem[]string | number | (string | number)[]AutocompleteContentProps{ align: 'start', side: 'bottom', sideOffset: 8 }booleanEmits
update:modelValue[value: string | number | (string | number)[] | undefined]update:open[value: boolean]Types
type AutocompleteItem = AutocompleteOption | AutocompleteLabelItem | AutocompleteDividerItem | string | number;interface AutocompleteOption {
label: string;
value: string | number;
icon?: string;
disabled?: boolean;
}interface AutocompleteLabelItem {
type: "label";
label: string;
}interface AutocompleteDividerItem {
type: "devider" | "divider" | "separator";
}interface AutocompleteContentProps {
align?: "start" | "center" | "end";
side?: "bottom" | "top";
sideOffset?: number;
}