autocomplete

Autocomplete

An input with suggestions that accepts free-form text; the value is the text itself.

Parts

PartFileDoes
AutocompleteAutocomplete.vueGroups all parts of the autocomplete, which lets the user type freely and pick from suggestions.
AutocompleteAnchorAutocompleteAnchor.vueFrames the input and its buttons as one field, and marks where the suggestion list attaches.
AutocompleteCancelAutocompleteCancel.vueClears the text the user has typed.
AutocompleteEmptyAutocompleteEmpty.vueShows a message when no suggestion matches the text.
AutocompleteGroupAutocompleteGroup.vueGroups related suggestions under an optional heading.
AutocompleteInputAutocompleteInput.vueTakes the text the user types; the suggestions filter as it changes.
AutocompleteItemAutocompleteItem.vueHolds one suggestion; picking it fills the input with its text.
AutocompleteListAutocompleteList.vueHolds the suggestions while the autocomplete is open.
AutocompleteSeparatorAutocompleteSeparator.vueSeparates groups of suggestions in the list.
AutocompleteTriggerAutocompleteTrigger.vueOpens and closes the suggestion list.
AutocompleteViewportAutocompleteViewport.vueScrolls the suggestions when the list is longer than the space available.

Anatomy

<Autocomplete>
  <AutocompleteAnchor>
    <AutocompleteInput />
    <AutocompleteCancel />
    <AutocompleteTrigger />
  </AutocompleteAnchor>
  <AutocompleteList>
    <AutocompleteViewport>
      <AutocompleteEmpty />
      <AutocompleteGroup>
        <AutocompleteItem />
      </AutocompleteGroup>
      <AutocompleteSeparator />
    </AutocompleteViewport>
  </AutocompleteList>
</Autocomplete>

Styling

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

Install

Installs with it
input-group
npm packages
@lucide/vue
@vueuse/core
reka-ui

Built from

API reference

Autocomplete.vue

Groups all parts of the autocomplete, which lets the user type freely and pick from suggestions.

Props 16

PropTypeDefault
modelValuestring—
defaultValuestring—
openboolean—
defaultOpenbooleanfalse
disabledbooleanfalse
dirDirection—
namestring—
requiredbooleanfalse
resetSearchTermOnBlurbooleanfalse
openOnFocusbooleanfalse
openOnClickbooleanfalse
ignoreFilterbooleanfalse
highlightOnHoverbooleantrue
loopbooleanfalse
asChildbooleanfalse
asAsTag | Component—

Events 3

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

Slots 1

SlotSlot props
default{ open: boolean; modelValue: string; }

AutocompleteAnchor.vue

AutocompleteCancel.vue

AutocompleteEmpty.vue

AutocompleteGroup.vue

AutocompleteInput.vue

AutocompleteItem.vue

AutocompleteList.vue

AutocompleteSeparator.vue

AutocompleteTrigger.vue

AutocompleteViewport.vue
Autocomplete
State