Skip to content
Tag label
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:
Name | Type | Description | Slot | A11y |
---|---|---|---|---|
content | string | The text content of the selection tag | default | |
model | boolean | The value of the selection tag | ||
checked | boolean | The value of the selection tag | ||
disabled | boolean | Disables 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.
Name | Payload | Description |
---|---|---|
change | boolean | Returns the new value of the "value" attribute |
restarted | void | Emitted on value reset |
Slots โ
This component has slots. Check the documentation about how to use the slots.
Name | Tags | Description |
---|---|---|
default | span |
Parameters use โ
content
โ
The z-selection-tag
parameter accepts a content
attribute to set the text label of the component.
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.
Methods โ
reset()
โ
We can all the reset()
method of the WebComponent in order to reset the value. This will clean the internal states and emit the nullable value with the change
event, plus a restarted
event:
In this example, the button triggers the method:
Value:ย
false
Browser support โ
Detected engine: ย
Chromium
Webkit
Gecko