# BaseChipsInput

Base Chips Input component with drop down and autocomplete functionality

# Props

Prop name Description Type Values Default
list list of selectable options (strings or objects) array - []
v-model list of already selected options (strings or objects), displayed as chips array - []
label input field label string -
showLabel define if label should be visible boolean - true
placeholder input field placeholder string - null
dropDownNoOptionsInfo message displayed when no selectable options are available string - 'No options available'
allowUnknownEntries define if the user can add an option that is not in the list boolean - false
allowMultipleEntries define only a single or multiple options can be selected boolean - true
allowDynamicDropDownEntries define if selectable list options should be fetched every time or if the
list passed in the beginning is used
boolean - false
addSelectedEntryDirectly this prop was added because there was some action needed to be done before entry was added
so this is possible if entry is not added to selectedList directly but only in parent
component
boolean - true
showInputBorder option to have the border of the input field not displayed boolean - true
sortable if true a button with that functionality will be visible boolean - false
draggable define if chips should be draggable (currently only available for inline) boolean - false
alwaysLinked define if entries should always appear linked (-> with grey background) boolean - false
hoverboxContent set content for the info box activatable by click.
see BaseHoverBox for more details
object - {}
isLoading show spinner to indicate that something is loading
(for dynamically fetched entries that need to do backend requests)
boolean - false
sortText if sorting is enabled this will be the text shown in the button string - 'Sort A – Z'
sortName if true sorting will consider the last string in a label or if a comma is
present the string before the comma
boolean - false
language set a language (ISO 639-1) string - ''
addNewChipText set a chips text for adding a new chip.
(alternatively add a form.Add value to your localization files)
if allowUnknownEntries is true please add this in one form or another!
string - ''
id if field is occuring more then once - set an id string - ''
identifierPropertyName specify the object property that should be used as identifier string - ''
labelPropertyName specify the object property that should be used as value to be displayed string - ''
displayChipsInline property for special case in component BaseChipsBelow - if false in this case chips will
not be displayed in the input field
boolean - true
required mark as required field (currently only used for aria-required attribute) boolean - false
invalid mark the form field as invalid and ideally also provide an error message
to display below the form field.
for an example see BaseInput
boolean - false
disabled set true if input field should be disabled.
for an example see BaseInput
boolean - false
errorMessage add an error message to be displayed below form field if field is invalid.
for an example see BaseInput
string - ''
showErrorIcon define if error icon should be shown.
for an example see BaseInput
boolean - false
clearable if true a remove icon (or a custom icon if slot remove-icon is used) will be shown allowing to remove
all input at once
for an example see BaseInput
boolean - false
inputClass specify additional input field styling string - ''
chipsEditable set true if chip should be editable on click

Caveat: chips can not be both draggable AND editable and it can not show
hoverBoxContent as soon as it is editable respectively - if both are set true edit
functionality takes precedent - chip will not be draggable, hoverBoxContent will not
be shown!
boolean - false
assistiveText this prop gives the option to add assistive text for screen readers
properties:
selectedOption: text read when a selected option is focused (currently only
working for editable chips)
object - {}

# Events

Event name Properties Description
fetch-dropdown-entries value string - the input string
type string - the labelPropertyName that was specified
event to fetch drop down entries with changing input
selected-changed undefined Object[], string[] - the altered selectedList inform parent of changes to selectedList
hoverbox-active value boolean - value describing if hoverbox active is true or false
option Object - the option for which the hoverbox was activated
event emitted on show / hide hoverbox

# Slots

Name Description Bindings
drop-down-entry a slot to provide more advanced drop down entries per default only the Object[labelPropertyName][?lang] will be displayed item string, Object - the option passed to options list
no-options a slot to customize messages in case of no options present in drop down
label-addition Slot 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-field slot to add elements within the form field but in a row before the actual input field. for an example see BaseChipsInputField
input-field-addition-before Slot to allow for additional elements in the input field &lt;div&gt; (before <input>). for an example see BaseChipsInputField
input-field-inline-before to add elements directly inline before the input (contrary to input-field-addition-before this does not wrap. for an example see BaseChipsInputField
input-field-addition-after for adding elements after input
post-input-field for adding elements at the end covering the whole height. for an example see BaseChipsInputField
error-icon use a custom icon instead of standard error/warning icon. for an example see BaseChipsInputField.
remove-icon use a custom icon instead of standard remove icon. for an example see BaseChipsInputField.

# Demo

Simple Single Choice Example with fixed dropdown, no unknown, not draggable

Additionally to the custom events listed above also all native input events are available.

Multiple Entries Example with fixed dropdown, no unknown and draggable

Last Updated: 3/27/2023, 4:42:24 PM