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

Both the background color and the text color can be customized using the --z-tag--bg and --z-tag--color CSS custom properties, respectively.

Custom tag

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹