Badge
A badge labels a status or a short fact, like Live, the time left or a number of markets.
Variant
Tone
Size
Icon
Label
JSX
<Badge variant="secondary" tone="success"><IconCheck />Passed</Badge>When to use
Section titled “When to use”- To show the state of something, like Live, Verified or Closed.
- To add a short fact to a row or card, like Market or 3 markets.
When not to use
Section titled “When not to use”- If it runs an action, use a button.
- If it filters a list, use chips or a segmented control.
- If it shows a price going up or down, use positive or negative text next to the number.
Anatomy
Section titled “Anatomy”- 1ContainerThe pill shape. Soft or Solid, coloured by the tone.
- 2IconOptional16px, in the tone's icon colour.
- 3LabelOne or two words, in semibold.
Variants and tones
Section titled “Variants and tones”Soft
SuccessInfo
Solid- Soft (
secondary) is for most labels, like Live on a market card or Verified next to an account. Its default tone is neutral. - Solid (
default) is for a badge that has to stand out on a busy row, like the one status that matters in a list. Its default tone is success.
Choose the tone by what the badge means, not by the colour you want.
- Success is for good or active states, like Live, Verified or Oversubscribed.
- Info is for neutral facts that need a little attention, like Upcoming or Requirements.
- Neutral is for plain labels and finished states, like Closed, Market or Limit.
+12.4%
Medium, 24px
Small, 20px
- Medium (24px) is the default.
- Small (20px) fits dense rows, tables and cards.
Content
Section titled “Content”- Keep it to one or two words, in sentence case, with no full stop.
- An icon before the label makes it quicker to read, like a check for Verified. Icons are 16px and use the tone’s icon colour. A badge has one icon at most.
Behaviour
Section titled “Behaviour”Badges can’t be clicked or focused. If people need to act on one, put a button next to it.
Accessibility
Section titled “Accessibility”- The words carry the meaning, so don’t rely on colour alone. Live and Closed have to say so in text.
- Icons inside a badge are decorative, because the label already says what they mean.
| Prop | Type | Default | Notes |
|---|---|---|---|
variant |
"secondary" | "default" |
"default" |
secondary is Soft, default is Solid. |
tone |
"success" | "info" | "neutral" |
neutral for Soft, success for Solid |
Choose by meaning, not colour. |
size |
"md" | "sm" |
"md" |
24px or 20px. |
asChild |
boolean |
false |
Gives the child the badge’s styles. |
Every other <span> prop passes through.
Related
Section titled “Related”- Use a Button when the label needs to do something.