Tag

Used for marking and selection.

Basic usage

Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.

Tag 1Tag 2Tag 3Tag 4Tag 5

Removable Tag

closable attribute can be used to define a removable tag. It accepts a Boolean. By default the removal of Tag has a fading animation. If you don't want to use it, you can set the disable-transitions attribute, which accepts a Boolean, to true. close event triggers when Tag is removed.

Tag 1Tag 2Tag 3Tag 4Tag 5

Edit Dynamically

You can use the close event to add and remove tag dynamically.

Tag 1Tag 2Tag 3

Sizes

Besides default size, Tag component provides three additional sizes for you to choose among different scenarios.

Use attribute size to set additional sizes with large, default or small.

LargeDefaultSmall

Theme

Tag provide three different themes: darklight and plain

Using effect to change, default is light

DarkTag 1Tag 2Tag 3Tag 4Tag 5
LightTag 1Tag 2Tag 3Tag 4Tag 5
PlainTag 1Tag 2Tag 3Tag 4Tag 5

Rounded

Tag can also be rounded like button.

Tag 1Tag 2Tag 3Tag 4Tag 5
Tag 1Tag 2Tag 3Tag 4Tag 5
Tag 1Tag 2Tag 3Tag 4Tag 5

Checkable Tag

Sometimes because of the business needs, we might need checkbox like tag, but button like checkbox cannot meet our needs, here comes check-tag. You can use type prop in 2.5.4.

basic check-tag usage, the API is rather simple.

CheckedToggle meDisabled
Tag 1 Tag 2 Tag 3 Tag 4 Tag 5 Tag 6

Tag API

Tag Attributes

NameDescriptionTypeDefault
typetype of Tagenumprimary
closablewhether Tag can be removedbooleanfalse
disable-transitionswhether to disable animationsbooleanfalse
hitwhether Tag has a highlighted borderbooleanfalse
colorbackground color of the Tagstring
sizesize of Tagenum
effecttheme of Tagenumlight
roundwhether Tag is roundedbooleanfalse

Tag Events

NameDescriptionType
clicktriggers when Tag is clickedFunction
closetriggers when Tag is removedFunction

Tag Slots

NameDescription
defaultcustomize default content

CheckTag API

CheckTag Attributes

NameDescriptionTypeDefault
checked / v-model:checkedis checkedbooleanfalse
disabled 2.8.2whether the check-tag is disabledbooleanfalse
type 2.5.4type of CheckTagenumprimary

CheckTag Events

NameDescriptionType
changetriggers when Check Tag is clickedFunction

CheckTag Slots

NameDescription
defaultcustomize default content

Source

ComponentStyleDocs

Contributors