Tag

Available since
@salt-ds/core@1.30.0

Tags communicate metadata that categorizes or groups content in an application. They are read-only, do not interfere with page interactions, and use categorical colors to draw attention. Tags appear as stylized elements with text, sometimes accompanied by an icon to reinforce their meaning.

Density
Mode

Tag has two variants: primary and secondary. The primary variant is set by default. Set to secondary with variant=”secondary”.

To add a border to tag, simply pass the bordered prop to the component.

Secondary tags have the ability to theme the border, although the border is not visible by default in the Salt theme.

Use an icon inside a tag to visually reinforce its content for quick recognition. Icons should be displayed before the label.

To differentiate between different categories, set a category by passing a value from 1 to 20 to the category prop.

Note that if a category outside the range is passed, the styles will default to category 1.

  • Be consistent when assigning categories. For example, avoid assigning two different categories to the same piece of metadata.

When using more than one tag next to each other, for example in a Card, apply --salt-spacing-50 between them.