Skip to content

Selection tag - Web Component

The SelectionTag component can be used imported from:

Playground

Parameters

The Web component uses the <z-selection-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
contentstringThe text content of the selection tagdefault
modelbooleanThe value of the selection tag
checkedbooleanThe value of the selection tag
disabledbooleanDisables the selection tag

Common API

For the basics, check the common specifications.

Events

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

NamePayloadDescription
changebooleanReturns the new value of the "value" attribute
restartedvoidEmitted on value reset

Slots

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

NameTagsDescription
defaultspan

Parameters use

content

The z-selection-tag parameter accepts a content attribute to set the text label of the component.

Tag label

model & checked

Both value and checked parameters are used to set the value of the component.

name

The attribute name will set the name of the component. This is useful when the component is part of a form.

The color and the size of the icon can be customized using the --z-selection-tag--color and --z-selection-tag--color--off CSS custom properties.

Flags

disabled

The attribute disabled will block the interaction with the component.

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example