InputTag ​

The InputTag component allows users to add content as tags.

Basic Usage ​

Press the Enter key to add the input as a tag.

Custom Trigger ​

You can customize the key used to trigger the input tag. The default key is Enter.


Maximum Tags ​

You can set a limit on the number of tags that can be added.

Disabled ​

You can set the InputTag to be disabled.

tag1tag2tag3

Clearable ​

You can set whether to show the clear button.

tag1tag2tag3

Draggable ​

You can set whether tags can be dragged.

tag1tag2tag3

Sizes ​

Add size attribute to change the size of InputTag. In addition to the default size, there are two other options: large, small.



Custom Tag ​

You can customize the tag content by tag slot.


tag1
tag2
tag3

Custom Prefix and Suffix ​

You can customize the prefix and suffix of the InputTag by prefix and suffix slot.

API ​

Attributes ​

NameDescriptionTypeDefault
model-value / v-modelbinding valuearray—
maxmax number tags that can be enternumber—
tag-typetag typeenuminfo
tag-effecttag effectenumlight
triggerthe key to trigger input tagenumEnter
draggablewhether tags can be draggedbooleanfalse
sizeinput box sizeenum—
clearablewhether to show clear buttonbooleanfalse
disabledwhether to disable input-tagbooleanfalse
validate-eventwhether to trigger form validationbooleantrue
readonlysame as readonly in native inputbooleanfalse
autofocussame as autofocus in native inputbooleanfalse
idsame as id in native inputstring—
tabindexsame as tabindex in native inputstring / number—
maxlengthsame as maxlength in native inputstring / number—
minlengthsame as minlength in native inputstring / number—
placeholderplaceholder of inputstring—
autocompletesame as autocomplete in native inputstringoff
aria-label a11ynative aria-label attributestring—

Events ​

NameDescriptionType
changetriggers when the modelValue changeFunction
inputtriggers when the input value changeFunction
add-tagtriggers when a tag is addedFunction
remove-tagtriggers when a tag is removedFunction
focustriggers when InputTag focusesFunction
blurtriggers when InputTag blursFunction
cleartriggers when the clear icon is clickedFunction

Slots ​

NameDescriptionType
tagcontent as tagobject
prefixcontent as InputTag prefix—
suffixcontent as InputTag suffix—

Exposes ​

NameDescriptionType
focusfocus the input elementFunction
blurblur the input elementFunction

Source ​

Component • Style • Docs

Contributors ​