Skip to content

BaseAutocompleteInput

Input component allowing to select single values from a drop-down that are filled into the input field as string

Props

Prop nameDescriptionTypeValuesDefault
modelValueinput field settable from outsidestring|number-''
listprovide a list of options for the drop-down.
could be a list of strings or objects - if it is objects if necessary please adapt
the props labelPropertyName (value to be displayed) and identifierPropertyName (used for
identification) for correct handling
array-[]
labellabel for input field, required for usability purposes, handle
showing of label with property showLabel
string-
showLabeldefines if input label should be visibleboolean-true
inputIdif field is occurring more then once - set an id
in case a custom input is used with the input slot it is important to
assign the same id to the input element
string-''
placeholderset a placeholder for the input fieldstring-'Enter Text Here'
requiredmark as required field (currently only used for aria-required)boolean-false
invalidmark the form field as invalid and ideally also provide an error message
to display below the form field
boolean-false
errorMessageadd an error message to be displayed below form field if field is invalidstring-''
showErrorIcondefine if error icon should be shownboolean-true
isActiveset input field in active state from outside.
the v-model directive can be used on this prop
boolean-null
showInputBorderoption to have the border of the input field not displayedboolean-true
useFormFieldStylingdefine if standard form field styling should be
used (otherwise no box shadow)
boolean-true
clearableif true a remove icon (or a custom icon if slot remove-icon is used) will be shown allowing to remove
all input at once
boolean-false
loadableif true space is reserved for a loader that can be activated
with the 'isLoading' prop
boolean-false
isLoadingshow spinner to indicate that something is loading
(for dynamically fetched entries that need to do backend requests)
boolean-false
languageset a language (ISO 639-1)string-''
disabledset true if input field should be disabledboolean-false
identifierPropertyNamespecify the object property that should be used as identifierstring-'id'
labelPropertyNamespecify the object property that should be used as value to be displayedstring-'label'
dropDownNoOptionsInfomessage displayed when no selectable options are availablestring-'No options available'
dynamicFetchif this is true parent needs to take care of filling the options list on string
input etc. - useful for fetching autocomplete options from a backend
boolean-true
highlightStringMatchset this flag to true to highlight autocomplete option characters that match
the current search input string
boolean-false
highlightStringTagsif highlightAutocompleteMatch is set true
provide tag names to style the matched characters
(without '<' and '>', e.g. ['b'] for <b>)
array-[]
assistiveTextloaderActive: add text that is announced when results are being fetched (prop
isLoading is set true)
clearInput: text read for remove input icon if prop clearable is set true
resultsRetrieved: text that is announced when results were retrieved (drop-down
list changed)
object-{
loaderActive: 'drop-down options are loading.',
clearInput: 'Clear input',
resultsRetrieved: '{number} options found with your input.'
}

Events

Event namePropertiesDescription
update:model-valueundefined string - the altered input stringevent triggered when input changes - part of v-model
fetch-dropdown-entriesvalue string - undefinedan event specifically triggered when drop-down should be fetched anew
when dynamicFetch is set true
update:is-activeundefined boolean - is input field activeupdate when active state of input field changes
the v-model directive can be used on this event
selectedundefined string, Object - selected option (if list of objects was provided the whole object)inform parent when an option was selected with all information provided in options list
(mainly useful when options list was array of objects - if strings this information
is provided with input event anyways)

Slots

NameDescriptionBindings
drop-down-entryprovide custom drop-down optionsitem string, Object - the option from provided options list
label-additionSlot to allow for additional elements on the right side of the label row <div> (e.g. language tabs)). for an example see BaseChipsInputField
pre-input-fieldslot to add elements within the form field but in a row before the actual input field. for an example see BaseChipsInputField
input-field-addition-beforeSlot to allow for additional elements in the input field <div> (before <input>). for an example see BaseChipsInputField
input-field-inline-beforeto add elements directly inline before the input (contrary to input-field-addition-before this does not wrap. for an example see BaseInput
input-field-addition-afterfor adding elements after input
post-input-fieldfor adding elements at the end covering the whole height. for an example see BaseChipsInputField
error-iconuse a custom icon instead of standard error/warning icon. for an example see BaseChipsInputField
remove-iconuse a custom icon instead of standard remove icon. for an example see BaseChipsInputField

Expose

inputElement

the native HTML input element


Demo

Form Input Field with Dynamic Autocomplete. The Toggle lets you choose if the options are provided as array of strings or objects.