Skip to content
On this page

Inputitems

A simple item input field that can have autocomplete functionality

Examples

Base

PistoiaValdinievole

Items: [ "Pistoia", "Valdinievole" ]

Show code

Autocomplete

Items: []

Show code

Custom selected

Items: []

Show code

Limits

0 / 5
0 / 5
Show code

Variants

One
One
One
One
One
Show code

Class props

'Classes applied to the element'
John
How does the Class props inspector work?
Class propDescriptionPropsSuffixes
autocompleteClassesClasses to apply on internal autocomplete. More detail here
closeClassClass of the close button of entered item.closable
counterClassClass of the counter element.hasCounter
maxitems
expandedClassClass of input when expanded.expanded
itemClassClass of the entered item.
rootClassClass of the root element.
variantClassClass of the entered item variant.variantprimary
info
warning
danger

Inputitems component

html
<o-inputitems></o-inputitems>

Props

Prop nameDescriptionTypeValuesDefault
allowAutocompleteAdd autocomplete feature (if true, any Autocomplete props may be used too)boolean-
allowDuplicatesAllows adding the same item multiple timeboolean-false
allowNewWhen autocomplete, it allow to add new itemsboolean-
appendToBodyAppend autocomplete content to bodyboolean-
ariaCloseLabelAccessibility label for the close buttonstring-
autocompleteNative options to use in HTML5 validationstring-
beforeAddingFunction to validate the value of the item before addingfunc-Default function (see source code)
checkInfiniteScrollMakes the autocomplete component check if list reached scroll end and emit infinite-scroll eventboolean-false
closableAdd close/delete button to the itemboolean-
From config:
inputitems: {
  closable: true
}
closeIconIcon name of close icon on selected itemstring-
From config:
inputitems: {
  closeIcon: 'close'
}
confirmKeysArray of keys
(https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
which will add a item when typing (default comma, tab and enter)
array-
From config:
inputitems: {
  confirmKeys: [',', 'Tab', 'Enter']
}
createItemFunction to create a new item to push into v-model (items)func-Default function (see source code)
dataItems dataarray-[]
disabledInput will be disabledboolean-
expandedMakes input full width when inside a grouped or addon fieldboolean-
fieldProperty of the object (if data is array of objects) to use as display textstring-'value'
groupFieldProperty of the object (if data is array of objects) to use as display text of groupstring-
groupOptionsProperty of the object (if data is array of objects) to use as key to get items array of each group, optionalstring-
hasCounterShow counter when maxlength or maxtags props are passedboolean-
From config:
inputitems: {
  hasCounter: true
}
iconIcon name to be addedstring-
iconPackIcon pack to usestringmdi, fa, fas and any other custom icon pack
keepFirstThe first option will always be pre-selected (easier to just hit enter or tab)boolean-
maxitemsLimits the number of items, plus item counternumber|string-
maxlengthSame as native maxlength, plus character counternumber|string-
onPasteSeparatorsArray of chars used to split when pasting a new stringarray-
From config:
inputitems: {
  onPasteSeparators: [',']
}
openOnFocusOpens a dropdown with choices when the input field is focusedboolean-
overrideboolean-
removeOnKeysAllow removing last item when pressing given keys, if input is emptyarray-
From config:
inputitems: {
  removeOnKeys: ['Backspace']
}
roundedMakes the element roundedboolean-
sizeVertical size of input, optionalstringsmall, medium, large
statusIconShow status icon using field and variant propboolean-
From config:
{
   "statusIcon": true
}
useHtml5ValidationEnable html 5 native validationboolean-
From config:
{
   "useHtml5Validation": true
}
v-modelarray-[]
validationMessageThe message which is shown when a validation error occursstring-
variantColor of the each items, optionalstringprimary, info, success, warning, danger, and any other custom color

Events

Event namePropertiesDescription
infinite-scroll
icon-right-click
blur
focus
invalid
update:modelValue
add
remove
typing

Slots

NameDescriptionBindings
selected
header
default
empty
footer

Sass variables

Current theme ➜ Oruga Base

SASS VariableDefault
$inputitems-background-color$input-background-color
$inputitems-heightcalc(2em - 1px)
$inputitems-paddingcalc(0.275em - 1px) 0 0
$inputitems-border-color$grey-lighter
$inputitems-border-stylesolid
$inputitems-border-width1px
$inputitems-border-radius$base-border-radius
$inputitems-color#363636
$inputitems-line-height$base-line-height
$inputitems-box-shadowinset 0 1px 2px hsla(0, 0%, 4%, 0.1)
$inputitems-max-width100%
$inputitems-width100%
$inputitems-counter-font-size0.75rem
$inputitems-counter-margin0.25rem 0 0 0.5rem
$inputitems-item-background-color$primary
$inputitems-item-color$primary-invert
$inputitems-item-border-radius$base-border-radius
$inputitems-item-margin0 0 0 0.275em
$inputitems-item-padding0 0.75em 0 0.75em
$inputitems-margin-icon-to-text0.1875em

See ➜ 📄 Full scss file

Current theme ➜ Oruga Full

SASS VariableDefault
$inputitems-background-color$input-background-color
$inputitems-heightcalc(2em - 1px)
$inputitems-paddingcalc(0.275em - 1px) 0 0
$inputitems-border-color$grey-lighter
$inputitems-border-stylesolid
$inputitems-border-width1px
$inputitems-border-radius$base-border-radius
$inputitems-color#363636
$inputitems-line-height$base-line-height
$inputitems-box-shadowinset 0 1px 2px hsla(0, 0%, 4%, 0.1)
$inputitems-max-width100%
$inputitems-width100%
$inputitems-counter-font-size0.75rem
$inputitems-counter-margin0.25rem 0 0 0.5rem
$inputitems-item-background-color$primary
$inputitems-item-color$primary-invert
$inputitems-item-border-radius$base-border-radius
$inputitems-item-margin0 0 0 0.275em
$inputitems-item-padding0 0.75em 0 0.75em
$inputitems-margin-icon-to-text0.1875em

See ➜ 📄 Full scss file

Current theme ➜ Bulma

The theme does not have any custom variables for this component.

Current theme ➜ Bootstrap

The theme does not have any custom variables for this component.

Released under the MIT License.