Badge

Labels a row or item with a short status or category.

Live React portVue source: WildBadge.vueStorybook story: Data Display/BadgeReact component: WBadge

Try it

Pick a colour, then switch emphasis to high.

Reporting
Colour
Emphasis
Size
Capitals
<WildBadge
  color="success"
  emphasis="low"
  size="xs"
>
  Reporting
</WildBadge>

When to use

  • Use a badge to label a row with a short status or category: Online, Pending, Low battery.
  • Use a badge for a fact and a chip for something a person chose. A badge is a small rounded rectangle; a chip has fully round ends.
  • Use low emphasis by default, and high only for the row that has to be found while scrolling.
Don’t use it
  • For anything a person can press, toggle or remove. Use a chip.
  • As the only sign of a status. The words carry the meaning; the colour backs them up.

Colours

Eight colours, each at two emphasis levels.

Online
ghost
Online
accent
Online
success
Online
warning
Online
error
Online
ultra
Online
neutral
Online
live
<WildBadge color="success">Online</WildBadge>
<WildBadge color="warning" emphasis="high">Low battery</WildBadge>
Use ultra for states that are notable but neither good nor bad, such as a site in calibration or a reading held for review.

Emphasis

Low is a tint with coloured text; high is a solid fill. Ghost and neutral share one high fill, so they’re left out below.

low
high
accent
Online
Online
success
Online
Online
warning
Online
Online
error
Online
Online
ultra
Online
Online
live
Online
Online
Keep high for the one row that needs finding, such as an offline logger or a failed sync. Used everywhere, it stops meaning anything.

Sizes

Online
2xs · 20
Online
xs · 24
Online
sm · 28
Pending
capitals
Reporting
live
Live adds a pulsing dot. It holds still when the reader has reduced motion turned on.

Accessibility

A badge isn’t focusable, and a screen reader reads its label as text. Every colour clears 4.5:1 at both emphasis levels but one: a high-emphasis live badge is white on blue-1000, accepted at 4.23:1.

  • Pass a label even with iconOnly. It’s hidden on screen and kept for screen readers.

Props

PropTypeDefaultDescription
color'ghost' | 'accent' | 'success' | 'warning' | 'error' | 'ultra' | 'neutral' | 'live''ghost'The status or category colour.
emphasis'low' | 'high''low'A tint with coloured text, or a solid fill.
size'2xs' | 'xs' | 'sm''xs'20, 24 or 28px tall.
capitalsbooleanfalseUppercase, with 0.5px letter spacing.
livebooleanfalseGreen fill with a pulsing dot.
iconReactNode—Icon before the label.
iconOnlybooleanfalseSquare badge; the label is kept for screen readers.
childrenReactNode—The label. One or two words.

Tokens

TokenValueWhere it lands
--radius-md6pxCorners.
--font-weight-medium475Label weight.
--color-primary-light#EBFAFFAccent ground.
--global-blue-1100#0C296AAccent text, 12.75:1 on the accent ground.
--color-primary#00AEEFAccent high fill, under #0A090B text.
--global-green-100#EBFBF1Success ground, and the live fill.
--global-green-900#018030Success text and high fill.
--global-red-900#BC1C1CError text.
--color-error#E12121Error high fill.
--color-warning#EC980CWarning high fill, under #0A090B text.
--color-success#019939The live dot.