Integrated ResearchPicasso
Components

Badge

A short, static label on a thing — a status, a count, a category.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

A short, static label on a thing — a status, a count, a category.

Import

import { Badge } from "@ir/ui";

Watch out

  • Outline ignores the colour. All five colours render identically in Figma — neutral fill, neutral border, neutral text — so 40 of the 120 variants collapse to 8. That is the file's spec and it is kept here, but it means <Badge variant="outline" color="danger"> is not a red badge and never was. Raised, not changed.
  • Neutral subtle takes border/neutral/subtle where every other colour takes border/<c>/muted — a quieter edge for the quiet colour. Also the file's spec.

Variants

AxisOptionsDefault
colorneutral · success · warning · danger · infoneutral
variantsubtle · emphasis · outlinesubtle
sizemd · lgmd

Props

PropTypeRequiredWhat it does
asChildbooleanRender as the child element, keeping Badge's styling.
dotbooleanAn 8px status dot before the label, in the matching status colour.

Do and don't

Use Chip for something selectable and Button for something that acts.

Don't — Make a badge clickable, or use one as a filter chip.

A badge is a label on a thing, not a thing to press. Making one clickable gives it no focus ring, no hit area and no keyboard route.

Keep the word — "Healthy", "Critical" — and add the dot if it helps.

Don't — Signal status with colour and nothing else.

Colour alone fails for anyone who cannot separate the hues, and a badge is small enough that the hue is all there is. The word is the signal; the colour reinforces it.

Show the one that changes what the reader does next.

Don't — Put three badges in a row on the same object.

Badges are loud by design. Three of them compete, and the reader ends up scanning past all three.

One or two words. Put the detail in the text beside it.

Don't — Write a sentence in a badge.

A badge does not wrap gracefully and cannot be read at a glance once it is longer than its container is wide.

Keep emphasis for the exception, and subtle for the rest.

Don't — Use emphasis badges everywhere because they read more clearly.

The solid fill is the loudest thing on most surfaces. Used for every row it becomes the background, and the one that matters disappears into it.

Use subtle for a quiet coloured badge; outline is deliberately neutral.

Don't — Reach for outline expecting a quieter red or green.

Outline renders identically for all five colours — neutral fill, neutral border, neutral text. Choosing it discards the colour rather than muting it.

Accessibility

  • The dot is aria-hidden. A badge's meaning is its text — colour and dot are reinforcement, never the signal.
  • Badge is not a live region. A count that changes while the page is open announces nothing unless the surrounding component says so.

Where it is drawn

Figma — structure from figma, measurements from figma.

Open in Storybook

On this page