Skip to content
Alea0.1

Data display

Badge

Small labels for status, category and counts.

Ant Design: Badge, Tag (static)

import { Badge, CountBadge } from '@alea/ui';

Examples

Tones

Soft by default, solid and outline for more or less weight.

neutralaccentsuccesswarningdangerinfo
neutralaccentsuccesswarningdangerinfo
neutralaccentsuccesswarningdangerinfo

Status and counts

A dot for live statuses, CountBadge for numbers.

LiveWaiting for approvalNew399+

Props

Badge props

A small status or count label. Not interactive.

PropTypeDefaultDescription
appearance"outline" | "soft" | "solid"'soft'soft (tinted, default), solid, or outline.
dotboolean-A dot before the text, for statuses.
size"sm" | "md"'md'sm 20 px or md 24 px (default).
tone"danger" | "success" | "warning" | "accent" | "info" | "neutral"'neutral'neutral, accent, success, warning, danger or info.

CountBadge props

A number bubble for notifications.

PropTypeDefaultDescription
countrequirednumber-The number to show.
labelstring-Name for screen readers, e.g. "unread messages".
maxnumber99Shows max+ above this. Default 99.
tone"danger" | "success" | "warning" | "accent" | "info" | "neutral"'accent'Color of the bubble. Default accent.

Accessibility

  • Badges are text, so their meaning doesn't depend on color; give a CountBadge a label.

Do and don't

Do

  • Use tones consistently: success for done, warning for attention.

Don't

  • Don't make a badge interactive: use Tag.
Tested with axe, keyboard and screen reader roles