Skip to content

Tag - Web Component

The Tag component can be used imported from:

Playground

Parameters

The Web component uses the <z-tag> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
contentstringDefines the text for the tag.default
fillstring

Defines the color for the tag. The default value is azure or default.

The possible values are: teal, moss, lilac, candy, peach, mint,lime, lemon, powder-pink

iconstringDefines the icon for the tag.
icon-rightbooleanDefines the icon position.

Slots

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanContent of the tag.

Parameters use

content

The thing to be assigned to the tag. It uses the default slot too.

Tag content

icon

We can set icon in the tags:

Tag contentTag content

icon-right

Also, the icons can be moved to the right using the icon-right flag:

Tag content

fill

The fill parameter is used to define the color of the tag. Being omitted the default value is azure.

The possible values are: teal, moss, lilac, candy, peach, mint,lime, lemon, powder-pink

Tag labelTag labelTag labelTag labelTag labelTag labelTag labelTag labelTag labelTag label

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example