Skip to main content

Autocomplete

The Autocomplete component offers simple and flexible type-ahead functionality. This is useful when searching large sets of data.

info

For more details about Vuetify’s usage of AutoComplete component, click AutoComplete page.
For more prop explanations, click Vuetify AutoComplete API page.

Props

AttributeDescriptionTypeDefault
attachSpecifies which DOM element that this component should detach to.booleanfalse
avoidClearableTabIndexWhen the clearable property is set to true, the clearable icon gets the tabIndex. To avoid this, avoidClearableTabIndex prop can be set to true.to.booleanfalse
appendIconAppends an icon to the component, uses the same syntax as icon.stringundefined
appendOuterIconAppends an icon to the outside the component's input, uses same syntax as iconstringundefined
autoSelectFirstWhen searching, will always highlight the first optionbooleanfalse
autofocusEnables autofocusbooleanfalse
backgroundColorChanges the background-color of the inputstringundefined
classAllows custom properties to take effect.stringundefined
clearIconApplied when using clearable and the input is dirtystringundefined
clearableAdd input clear functionality.booleanfalse
compareValueQLegend is used for comparison values. You can look at the QLegend documentstringundefined
compareTextQLegend is used for comparison values. You can look at the QLegend documentstringundefined
compareTableValueQLegend is used for comparison values. You can look at the QLegend documentstringundefined
counterCreates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation.boolean-number-stringundefined
counterValuefunction
darkApplies the dark theme.booleanfalse
deletableChipsAdds a remove icon to selected chips.booleanfalse
disabledDisables the input.booleanfalse
eagerWill force the components content to render on mounted.booleanfalse
errorPuts the input in a manual error state.booleanfalse
errorCountThe total number of errors that should display at oncenumber | string1
errorMessagePuts the input in an error state and passes through custom error messages.stringundefined
formatIt is used to format the entered values. You can find more detailed information herestringundefined
heightSets the height of the input.number-stringundefined
hideDetailsHides hint and validation errors.boolean-stringundefined
hideNoDataHides the menu when there are no options to show.booleanfalse
hideSelectedDo not display in the select menu items that are already selected. Also removes checkboxes from the list when multiplebooleanfalse
itemsCan be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys.arrayundefined
itemDisabledSet property of items’s disabled valuestring-array-functiondisabled
itemTextSet property of items’s text valuestring-array-functionundefined(text)
itemValueSet property of items’s value - must be primitive.string-array-functionundefined(value)
labelSets input label.stringundefined
loadingDisplays linear progress bar.booleanfalse
maxLengthThe maximum size that the entered value can take.stringundefined
menuPropsPass props through to the menu component.string-array -object
multipleChanges select to multiple. Accepts array for value.booleanfalse
noDataTextDisplay text when there is no datastringundefined
noFilterDo not apply filtering when searching. Useful when data is being filtered server sidebooleanfalse
outlinedApplies the outlined style to the input.booleanfalse
persistentHintForces hint to always be visible.booleanfalse
persistentPlaceHolderForces placeholder to always be visible.booleanfalse
placeholderSets the input’s placeholder text.stringundefined
prefixDisplays prefix textstringundefined
prependIconPrepends an icon to the component, uses the same syntax as iconstringundefined
prependInnerIconPrepends an icon inside the component’s input, uses the same syntax as icon.stringundefined
preventPastePrevents copy-pasting of databooleanfalse
readonlyPuts input in readonly state.booleanfalse
rulesAccepts a mixed array of types function, boolean and string. Functions pass an input value as an argument and must return either true / false or a string containing an error message.string-arrayundefined
smallChipsChanges display of selections to chips with the small propertybooleanfalse
soloChanges the style of the input.booleanfalse
successPuts the input in a manual success state.booleanfalse
successMessagePuts the input in a success state and passes through custom success messages.stringundefined
suffixDisplays suffix textstringundefined
validateOnBlurDelays validation until blur eventbooleanfalse
tabIndexAllows component to give and receive focus.numberundefined
valueThe input’s valuenumberundefined
visibleVisibility of AutoComplete componentbooleantrue

Events

NameDescriptionType
blurEmitted when the input is blurredEvent
changeEmitted when the input is changed by user interactionany
clickEmitted when input is clickedMouseEvent
click:appendEmitted when appended icon is clickedEvent
click:append-outerEmitted when appended outer icon is clickedEvent
click:clearEmitted when clearable icon clickedEvent
click:prependEmitted when prepended icon is clickedEvent
click:prepend-innerEmitted when prepended inner icon is clickedEvent
filterThe filtering algorithm used when searching.Event
focusEmitted when component is focusedEvent
inputThe updated bound modelany
keydownEmitted when any key is pressedKeyboardEvent
mousedownEmitted when click is pressedMouseEvent
mouseupEmitted when click is releasedMouseEvent
update:search-inputThe search-input.sync eventstring

Slots

NameDescription
appendAdds an item inside the input and after input content
append-itemAdds an item after menu content
append-outerAdds an item outside the input and after input content
counter{props: {dark: boolean,
light: boolean,
max: string or number,
value: string} }
itemDefines a custom item appearance
labelReplaces the default label
message{ key: number, // the messages index
message: string, // the message}
no-data
prependAdds an item outside the input and before input content
prepend-innerAdds an item inside the input and before input content
prepend-itemAdds an item before menu content
progressSlot for custom progress linear (displayed when loading prop is not equal to Boolean False)
selectionDefines a custom selection appearance

Usage Scenario

  • Each item in the array assigned to the items prop of the component should have keys named text and value.
  • Assign text to the itemText prop of the component.
  • Assign value to the itemValue prop of the component.
  • If only one value is to be displayed (no separate fields for text and value), the same value can be assigned to both keys.