Label tag
A label tag shows a label assigned to an item, such as a post or a conversation, and can let users remove it.
- In progress
- Storybook (opens in a new tab)
- Figma library (opens in a new tab)
npm install @sbks/ds-elements
When to use
Section titled “When to use”Label tags show which labels an item carries, for example in a list of posts or in a form. Where users can edit the labels, they can remove a label right from its tag.
Use a label tag to show a label that users assign to an item and can take away again.
Don’t use a label tag to show the status of an item. Use a badge instead.
Anatomy
Section titled “Anatomy”
Default

Hover
- Additional content. An icon or a letter that adds context to the label. It takes the place of the leading stripe.
- Label. The name of the label. A long name is shortened in the middle.
- Remove button. Optional. Appears over the end of the label when the pointer is on the tag.
Variants
Section titled “Variants”Default. A static tag that users can’t remove. A stripe on the leading edge marks it as a label. The stripe is decorative and carries no meaning.
Removable. A remove button lets users take the label off the item. Show it only where users can edit the labels of the item. Leave it out when users don’t have permission to change labels, and in read-only views such as reports.
With an icon. An icon in front of the label adds context.
Automatic. A letter in front of the label shows that the label was assigned automatically, for example by a rule, not by a user.
States
Section titled “States”- Default: the tag shows the label.
- Hover: on a removable tag, the remove button appears over the end of the label. Its cross turns red when the pointer is on it, because removing is a destructive action.
- Long label: a name longer than the tag is shortened in the middle, so both its start and end stay readable. Hovering the label shows the full name in a tooltip.
Behavior
Section titled “Behavior”- The tag is as wide as its label, up to a maximum width. The maximum can be changed when a layout needs it.
- Clicking the remove button removes the label from the item right away, without a confirmation.
Best practices
Section titled “Best practices”

Accessibility
Section titled “Accessibility”- Screen readers announce the name of the label, and the remove button says which label it removes.
- Users can reach the remove button with the Tab key. The button becomes visible when it gets focus, and Enter or Space removes the label.
- The full name of a shortened label shows in a tooltip on hover.
Related components
Section titled “Related components”- Badge: shows a status or a piece of information that users can’t remove.
- Label tag group: shows several label tags of one item together.
- Platform tag: shows which social network a profile, post or channel belongs to.