Tag
Tags are compact labels used to categorize or highlight content, helping users quickly identify status, type, or context.
Quarantine
Tags label, categorise, or highlight content in a compact form. They help users identify the status, context, or type of information quickly and consistently. A Tag can include an optional icon or link, depending on the use case.
Anatomy
Section titled “Anatomy”- Tag
- Star
- Tag text
- Link
When to use it
Section titled “When to use it”Use a Tag when:
- You need to indicate the status or category of an element (Success, Danger, Information).
- You’re displaying metadata or filters (search results, applied filters).
- You need to highlight a contextual link via the Has Link variant.
Avoid Tags when:
- The action is a primary CTA — use buttons.
- The layout is dense and tags would add visual noise without hierarchy.
- A plain label or badge would suffice without any interaction.
Properties
Section titled “Properties”Type
Five semantic types: Success, Danger, Info, Inactive, and Neutral. Each carries a distinct colour set tuned to the meaning, so a Success tag reads as positive across both visual styles.
Style
Two visual styles: Subtle uses a tinted background with a border, Bold uses a solid background. Subtle reads quieter inside lists and cards; bold draws more attention to a single item.
Icon
Optional leading icon, useful for reinforcing the meaning (a check for Success, a warning for Danger). Decorative icons should stay hidden from assistive tech.
Link
Optional trailing Link Button, used when the tag pairs a label with a contextual action. The link inherits the Tag text colour for legibility.
Platform considerations
Section titled “Platform considerations”Desktop
Tags sit comfortably inline next to titles or metadata. Keep their padding consistent across surfaces so the rhythm of a page holds.
Tablet
Same inline placement. Watch tag density inside cards — too many tags in one row crowd the layout quickly.
Mobile
Stack tags onto multiple rows rather than truncating the labels. Keep the leading icon (if any) at its natural size so the meaning still reads.
Best practices
Section titled “Best practices”Tags are designed for light mode only — they’re intended for use inside cards, which always have a white or near-white background. They are not tested for use on dark or coloured surfaces.
Do
Use tags to clarify type or status, combine with links when contextually relevant, keep labels short and clear, and lean on the subtle style by default — it includes a border that lifts contrast on light surfaces.
Don't
Don’t use tags as buttons (reach for the actual Button component), don’t place tags over dark backgrounds (the colour set isn’t tested there), and don’t pack too many tags into a small space — visual noise hides the meaning.
Content guidelines
Section titled “Content guidelines”Tag text should be short, ideally one or two words, and name the status or category in plain language (“In stock”, “Available”, “Sold out”). Use sentence case (“In stock”, not “IN STOCK”) and skip trailing punctuation. When a tag pairs with a link, the link label should name the action (“View details”) so the two read as a coherent unit rather than a redundant repeat.
Styles
Section titled “Styles”<div class="tng-tag"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div>Variants
Section titled “Variants”<div class="tng-tag is-error"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div><div class="tng-tag is-info"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div>Success
Section titled “Success”<div class="tng-tag is-success"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div><div class="tng-tag is-bold"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div><div class="tng-tag is-bold is-error"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div><div class="tng-tag is-bold is-info"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div><div class="tng-tag is-bold is-success"> <i aria-hidden class="tng-icon icon-star"></i> <span>Tag text</span> <a class="tng-link" href="#">Link</a></div>A tag is a compact, mostly static label — it categorises or highlights content and usually carries no interaction of its own, so it follows no single WAI-ARIA pattern; it meets WCAG 2.1 AA by leaning on plain text semantics. An accessible tag reads the same whether the user sees it, hears it, or tabs to its controls: its label is real text, any decorative icon stays out of the assistive-technology tree, a dismissible tag exposes its close affordance as a native button with a clear name, and its status is never carried by colour alone.
For designers
Section titled “For designers”- The label text (12px Book) against its surface, and every background, border, and status-fill combination, must maintain accessible contrast on every supported surface. Source: WCAG 1.4.3 Contrast (Minimum).
- Status must never be conveyed by colour alone — pair each variant (
is-error,is-info,is-success) with text or an icon so the meaning survives for colour-blind and monochrome users. A meaningful icon must not merely duplicate the label; a decorative one carries no meaning at all. Source: WCAG 1.4.1 Use of Color. - When a tag carries a focusable control — a dismiss button or a link — its focus style must stay visible, meet contrast requirements on every supported surface, and be clearly distinguishable from hover. A tag link must also read as distinct from the surrounding tag text. Source: WCAG 2.4.7 Focus Visible.
- Use semantic colour tokens (e.g.
foreground/neutral/default) rather than fixed values, so the component adapts correctly across themes and surfaces. - Tags use no animation or flashing and introduce no visual noise, so they raise no motion concern.
For developers
Section titled “For developers”A plain tag is just text inside a .tng-tag container — it takes no role and no interactive semantics, and a screen reader announces its label like any other text. Two decisions shape whether that stays accessible, and both are wired per element in the Labelling elements section below: keep any leading icon decorative so it doesn’t double-announce the label, and — when the tag is dismissible — expose the close affordance as a native <button> with its own accessible name rather than a click-handling <span>. Where a tag contains a link, use a native <a> (.tng-link) so it is focusable and operable for free. Never let the status variant’s colour be the only signal of meaning.
Labelling elements
Section titled “Labelling elements”Give every element the role, name, and state assistive technology needs.
Tag / Label
The .tng-tag container carries no role — it is presentational. Its accessible name is its own text content (the <span> label), so keep that label short and self-describing; it announces as plain text with no added ARIA.
Decorative icon
The leading <i class="tng-icon"> is decorative: mark it aria-hidden="true" so it is removed from the accessibility tree and never doubles the label. If an icon genuinely adds meaning the label doesn’t, surface that meaning in text rather than leaving it on a hidden icon.
Dismiss button
When the tag can be removed, the close affordance is a native <button> — it carries role="button" and keyboard operation for free. Give it an accessible name that says what it removes, aria-label="Remove <name>" (e.g. "Remove Hybrid"), and mark its icon aria-hidden="true" so only the label is announced.
Source: WCAG 4.1.2 Name, Role, Value.
Content / Copy guidelines
Section titled “Content / Copy guidelines”Tags should use short, descriptive and consistent labels. The tone should be neutral, informative, and suitable for metadata or UI contexts.
- Text: Mandatory. One to three short words (e.g. “Hybrid”, “Low stock”, “Special edition”).
- Capitalisation: Sentence case (e.g. “In progress”).
- Max length: Aim for 18 characters or fewer to ensure layout stability.
- Icons: Optional. Should visually support the text meaning, not repeat it.
- Links: Optional. Must use clear, concise language (e.g. “Edit”, not “Click here”).
- Do not use emojis or punctuation in Tag labels.
- Avoid using verbs in the main label unless combined with a link.