Skip to content

BaseDropDownList

a multipurpose drop-down list

Props

Prop nameDescriptionTypeValuesDefault
dropDownOptionslist of options to select from, this needs to be an object with identifier
and label (the actual property names can be adapted with
identifierPropertyName and labelPropertyName respectively)
array-[]
identifierPropertyNamespecify the name of a property that can be used as identifierstring-'id'
labelPropertyNamespecify the name of the property that should be displayedstring-'value'
activeOptionspecify the currently active option (will have gray background
if not disabled by setting activeStyled false) for example for
combination with input and keyboard use
object-{}
selectedOptionspecify the currently selected option (will appear in app color if not disabled
by setting selectStyled false, but also used for aria-selected).
the v-model directive can be used here
object-{}
listIdin order to link the drop-down body to an <input> element specify a list
id and use the list attribute on the input
string-''
listBodyStyleadd styling to the list body (e.g. max-height) (useful
if slots before-list or after-list should not be part of scroll container)
object-{}
activeStyledflag if the currently active element should be styled
(gray background)
boolean-true
selectStyledflag if the currently selected entry should be styled
(only makes sense for single select, color: app-color)
boolean-false
displayAsDropDownif true the element will be styled as a drop-down element with
box-shadow
boolean-true
dropDownNoOptionsInfomessage displayed when no selectable options are availablestring-''
languagespecify a language (ISO 639-1) (used for label if label is language specific object
e.g. { de: 'xxx', en: 'yyy' }
string-''
activeSubOptionthis adds the possibility of nested options (thus a second list nested within the first one),
if an active sub-option is added, this will have consequences for scroll adjustment of list
on keyboard use and how the active option is determined (the identifier property will be used)
object|null-() => null
useCustomOptionActiveBackgroundColorin case a custom option background should be set to the currently active option
(this will also apply if activeStyled is set false).
if you want to use this option please set the css variable --option-background
in your app
boolean-false
useHighlightStringMatchset true if option characters matching a string provided in highlightStringMatch
should be highlighted
boolean-false
highlightStringMatchif useHighlightStringMatch is set to true, provide a string to match with the
option label here
string-''
highlightStringTagsprovide tag names to style the matched characters
(without '<' and '>', e.g. ['b'] for <b>)
array-[]

Events

Event namePropertiesDescription
update:selected-optionundefined Object - the selected optioninform parent if option was selected by mouse click
(v-model on prop selectedOption can be used)

Slots

NameDescriptionBindings
before-listfor adding elements before the options list
optiona slot to customize every single option (e.g. display of information other than [valuePropertyName])option Object - the current option in the options list
no-optionscustomize what is displayed when no drop down options are available
after-listto add elements after the options list

Demo

A list in drop down style. Click the button to display!

An example connected with an input field (displayAsDropDown: false) using all kinds of slots and with useHighlightStringMatch enabled.