Skip to content

Badge

Small status label for counts, tags, and state indicators.

  • stable
  • since v0.1.0
  • 0.97 kB
  • feedback
  • label
  • status

Renders as a <span>; dot mode sets aria-hidden by default — provide aria-label when the dot conveys meaningful status.

Preview
Open
tsx

Badge ships four visual variants — solid, soft (default), outline, and ghost — each available in six color schemes: accent, neutral, success, warning, danger, and info.

Preview
Open
tsx

Pass dot to render a bare coloured dot with no text content. Supply an aria-label to keep the indicator accessible.

Preview
Open
tsx
PropTypeDefaultDescription
variant
"solid"|"soft"|"outline"|"ghost"
soft
Visual style. `soft` reads as informational; `solid` draws more attention; `outline` is minimal; `ghost` is borderless.
colorScheme
"accent"|"neutral"|"success"|"warning"|"danger"|"info"
neutral
Semantic palette. One of `neutral`, `accent`, `success`, `warning`, `danger`, `info`.
size
"xs"|"sm"|"md"
md
Pixel scale. One of `xs`, `sm`, `md`.
shape
"default"|"pill"|"square"
default
Outline shape. `default` is gently rounded; `pill` is fully rounded; `square` has no corner rounding.
icon
ReactNode
Leading icon rendered before the children.
dot
boolean
false
Render as a bare coloured dot (no content).
  • Rendered as a native <span> — purely presentational by default.
  • In dot mode with no children, aria-hidden="true" is set automatically. Add an explicit aria-label when the dot conveys meaningful information (e.g. online status).
  • Colour alone is never the only signal — pair with a visible label or aria-label for colour-blind users.
  • Use shape="pill" for rounded pill badges (e.g. notification counts).
  • Use shape="square" for icon-only square badges.
  • Use icon prop to prepend a decorative icon: <Badge icon={<StarIcon />}>Featured</Badge>.
  • Combine size="xs" with dot for tight inline status dots next to usernames or connection states.