Demos
Tag
There are three interactive tag variants:
clickable
(can also accept a custom icon as it does not have on of its own)addable
removable
(also triggersonClick
when pressing theDelete
orBackspace
keyboard key (keyup
event), can be disabled with theomitOnKeyUpDeleteEvent
prop)
We require <Tag>
-components to be wrapped by a <Tag.Group>
-component. The required label
-property in <Tag.Group>
will ensure the correct use of accessibility for screen readers.
Interactable tags
Code Editor
<Tag.Group label="Interactable tags"> <Tag variant="clickable" onClick={() => 'click'} > Clickable </Tag> <Tag variant="addable" onClick={() => 'click'} > Addable </Tag> <Tag variant="removable" onClick={() => 'click'} > Removable </Tag> </Tag.Group>
Non-interactive tag
- Not interactable
- Can have icon
Non-interactable tags are simply made by skipping all callback props, and are the only type that can have an icon.
Payment types
Non-interactive tag with icon
Betalingstyper
Usage examples
Multiple removable tags
Removable tags can for example be used in filter lists. This is a simple example on how to implement a filter list using removable Tags
.