To have autocomplete functionality, add the autocomplete
prop.
You can add any prop from Autocomplete API.
Taginput
A simple tag input field that can have autocomplete functionality
Tags: [ "Auckland", "Wellington", "Very long string that would overflow" ]
# Autocomplete
Tags:[]
# Templated Autocomplete
Slots are available for autocomplete items and the empty message, like with the Autocomplete control.
Tags:[]
# Limits
You can limit the length and number of tags with the maxlength
and maxtags
props.
Maxlength counter is only shown when typing.
# States
You can change the input type setting a type
on Field.
# Tag types
# Sizes
# Modifiers
You can change the style of the tags by setting the rounded
and attached
props.
# Validation
You can validate the value before adding it to the tag list
# API
Name | Description | Type | Values | Default |
---|---|---|---|---|
v-model | Binding value | Array<String>, Array<Number>, Array<Object> | — | — |
maxlength | Limits the length of each tag, plus character counter | String, Number | — | — |
maxtags | Limits the number of tags, plus tag counter | String, Number | — | — |
has-counter | Show counter when maxlength or maxtags props are passed | Boolean | — | true |
type | Type (color) of the tags, optional | String | is-white , is-black , is-light ,
is-dark , is-primary , is-info , is-success ,
is-warning , is-danger ,
and any other colors you've set in the $colors list on Sass | is-light |
size | Tag and input size, optional | String | is-small , is-medium , is-large | is-medium |
rounded | Makes the tags rounded, optional | Boolean | — | false |
attached | Makes the tags attached instead of having an appended delete button, optional | Boolean | — | false |
ellipsis | Adds ellipsis on tags to not overflow the text. Title is then added to the tag with full text | Boolean | — | false |
closable | Add close/delete button to the tag | Boolean | — | true |
field | Property of the object (if data is array of objects) to use as display text | String | — | value |
autocomplete | Add autocomplete feature (if true , any Autocomplete props may be used too) | Boolean | — | false |
allow-new | When autocomplete , it allow to add new tags | Boolean | — | false |
remove-on-keys | Allow removing last tag when pressing given keys, if input is empty | Array | — | [8] |
confirm-key-codes | Array of key codes which will add a tag when typing (default comma, enter and tab) | Array | — | [13, 188, 9] |
on-paste-separators | Array of chars used to split when pasting a new string | Array | — | [','] |
before-adding | Function to validate the value of the tag before adding | Function | — | (tagToAdd) => true |
allow-duplicates | Allows adding the same tag multiple times | Boolean | — | false |
readonly | Disable input/typing | Boolean | — | false |
check-infinite-scroll | Makes the autocomplete component check if list reached scroll end and emit infinite-sroll event. | Boolean | — | false |
Any other native attribute | — | — | — | — |
# Variables
You can use these variables to customize this component.
Name | Default |
---|---|
$taginput-height | 1.7em |
This page is open source. Noticed a typo or something's unclear?