Badge
Status – Label
Badges are compact visual indicators used to highlight status, categories, or counts.
Ready to use
Badges are compact, non-interactive indicators that label an item with a status, category, or count. They sit alongside the content they describe — a name, a list item, an icon — and carry their meaning in a short piece of text, a semantic colour, and an optional icon. Reach for a badge to surface a small piece of at-a-glance information, not to trigger an action or offer a choice.
Anatomy
Section titled “Anatomy”- Badge
- Icon
- Label
The Badge container carries the shape, fill, and border that set the badge apart from its surroundings. The Icon is optional — status badges pair a decorative icon with the label to reinforce meaning without relying on colour, and a count badge drops it entirely. The Label holds the text, count, or accessible name that tells the user what the badge means.
When to use it
Section titled “When to use it”Use a badge when:
- You need to flag the status of an item — success, error, warning, or an informational note.
- You want to show a count, such as unread notifications or items in a cart.
- You’re labelling an item with a short, read-only category or tag.
- The information supports the content it sits beside rather than standing on its own.
Avoid a badge when:
- The element should be selectable or dismissible — reach for a Chip instead.
- The user needs to trigger an action — use a Button.
- The label carries a long string of text; badges are sized for a word or two.
- The meaning lives only in the colour, with no text or icon to back it up.
Properties
Section titled “Properties”Type
Two types cover the range: a status badge labels an item with a word or short category and, where it carries a state, a semantic colour and icon; a count badge shows a number. Both keep the same pill shape and only swap fill, border, and content.
Status
Status badges come in five semantic types — Neutral, Error, Success, Warning, and Info — each with its own muted fill and border token so the meaning reads consistently across themes. Neutral is the plain-text case and carries no icon; the other four take a leading icon that picks up the border colour (a cross for error, a check for success, an exclamation for warning, an “i” for info), so the state survives in greyscale and for colour-blind users. The label itself stays neutral in every type — the colour lives in the fill, the border, and the icon.
Count
A count badge renders a number in one of two styles — Filled, a solid dark fill with light text for high visibility, and Outlined, a light fill with a border for a quieter treatment. It keeps the badge’s pill shape but takes a square aspect ratio, so a single digit reads as a circle.
Platform considerations
Section titled “Platform considerations”Desktop
Badges sit inline next to the item they describe — a table cell, a list row, a heading. Keep them close to their subject so the association is obvious, and let the small size keep the layout tight.
Tablet
The same inline placement works, with a touch more breathing room around dense clusters. Badges take no touch target of their own since they’re non-interactive, so they can stay compact.
Mobile
Space is tight, so favour count and status badges that carry meaning in a glyph or a single word. Let badges wrap with their content rather than truncating, and keep the text legible against whatever surface they land on.
Best practices
Section titled “Best practices”Badges work best when they stay small and unambiguous — one idea per badge, backed by text or an icon rather than colour alone.
Do
Keep labels to a word or two, pair every status colour with an icon or text so the meaning survives in greyscale, and place the badge right beside the item it describes. Use the semantic status type that matches the meaning, and reach for the filled count treatment only when the number genuinely needs to pull attention.
Don't
Don’t make a badge interactive — if it should be clicked, toggled, or dismissed, it’s a chip or a button. Don’t rely on colour alone to carry the status, don’t pack a sentence into a badge, and don’t scatter so many badges around one item that none of them stands out.
Content guidelines
Section titled “Content guidelines”Badge text should be short and scannable — ideally one or two words in sentence case, with no trailing punctuation. Name the status or category in plain language (“In stock”, “Overdue”, “Beta”) and keep labels parallel across a group so they read as a set. For count badges, show the raw number and cap large values with a “+” suffix (for example “99+”) rather than letting the badge grow. When a badge’s meaning isn’t obvious from a bare glyph or number — a count, an icon-only status — make sure its accessible name spells the meaning out.
A Badge is a non-interactive indicator, so render it with a non-interactive inline tag such as <span>. .tng-badge is an inline flex row, so it sits alongside whatever it describes and shrinks to its content. Without a modifier it renders the neutral status.
Elements
Section titled “Elements”A leading icon is optional and always decorative — mark it aria-hidden="true" and keep the meaning in the text. The icon takes the badge’s border colour automatically, and .tng-badge:has(.tng-icon) tightens the inline-start padding so an icon badge stays balanced.
<span class="tng-badge"> <i class="tng-icon icon-info" aria-hidden="true"></i> <span>Toyota</span></span>Variants
Section titled “Variants”Four feedback modifiers recolour the fill and the border — and with it the icon. The text stays neutral in every one, so pair each modifier with an icon or wording that names the state rather than relying on the colour alone.
<span class="tng-badge is-error"> <i class="tng-icon icon-close" aria-hidden="true"></i> <span>Error</span></span><span class="tng-badge is-info"> <i class="tng-icon icon-info" aria-hidden="true"></i> <span>Info</span></span>Success
Section titled “Success”<span class="tng-badge is-success"> <i class="tng-icon icon-check" aria-hidden="true"></i> <span>Success</span></span>Warning
Section titled “Warning”<span class="tng-badge is-warning"> <i class="tng-icon icon-error" aria-hidden="true"></i> <span>Warning</span></span>Number
Section titled “Number”Add is-number to render a count. The badge takes a square aspect ratio so a single digit reads as a circle, and the text is set semibold on a neutral surface. Add is-contrast alongside it for the filled treatment — a dark surface with light text — for counts that need to pull more attention. is-contrast does nothing on its own; it only applies in combination with is-number.
A count badge ships in one size and grows with its content rather than truncating, so cap long values in the markup (99+) instead of letting the badge stretch.
<span class="tng-badge is-number">1</span><span class="tng-badge is-number is-contrast">99</span>A badge is a small, non-interactive label or indicator that conveys a status, category, or count. It takes no keyboard focus and follows no APG interaction pattern — so an accessible badge is about meaning, not operation, and meets WCAG 2.1 AA. Its meaning must live in text (or an accessible name), never in colour alone; and when a badge reflects an important or changing status — such as a notification count — that status must be exposed to assistive technology rather than left as a purely visual cue.
For designers
Section titled “For designers”- Badge text and its background must meet contrast minimums on every surface the badge sits on. Source: WCAG 1.4.3 Contrast (Minimum).
- Status must never be conveyed by colour alone — an error badge and a success badge must also differ in text, icon, or shape, so the meaning survives for colour-blind users and in greyscale. Source: WCAG 1.4.1 Use of Color.
- Use semantic colour tokens (e.g.
foreground/neutral/default) rather than fixed values, so the badge adapts correctly across themes and surfaces.
For developers
Section titled “For developers”A badge renders as a non-interactive element — a <span>, not a control — and is not in the tab sequence, so it needs no keyboard or focus handling and no role. Add ARIA only where the meaning isn’t already carried by visible text; the per-variant naming is in the Labelling elements section below.
Labelling elements
Section titled “Labelling elements”Give each badge variant the accessible name assistive technology needs.
Status badge
Takes its accessible name from its visible text content — keep that text self-describing and no ARIA is needed. The leading icon is decorative and repeats what the text already says, so mark it aria-hidden="true". Use a .sr-only span if the label has to be visually hidden.
Number badge
A bare count like 3 isn’t self-explanatory — add an aria-label that supplies the context, e.g. aria-label="3 unread notifications". When the count updates in place, wrap it in role="status" so the change is announced.
Icon-only badge
A badge with an icon and no text has nothing to name it — give the badge an aria-label that states the meaning and keep the icon itself aria-hidden="true", so the name comes from the badge rather than from the glyph.
Source: WCAG 4.1.2 Name, Role, Value.