Skip to content
esc

Badge

Feedbackshadcn/ui

A short label for a status or category: 'Pending', 'Paid', 'New'. Status variants are tinted, not solid.

When to use

  • Use one or two words.
  • Map status consistently: success = done or paid, warning = pending, destructive = failed.
  • Don't make badges clickable buttons; use Button size sm.
  • Don't stack more than two badges on one row.

Accessibility

Role
none (span)
Keyboard
Not focusable.
Notes
Don't rely on color alone: the text must say the status.

Props

  • variant= 'secondary'

    'secondary' | 'default' | 'outline' | 'brand' | 'success' | 'warning' | 'destructive'

    Meaning.

  • asChild= false

    boolean

    Render a link with badge styles.

Prompt for your agent

Use the UnbuiltUI Badge. Call unbuilt_get_component("Badge") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

7 variants1 state2 props4 usage rules2 a11y notes13 tokens2 examples

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/badge.json

Tokens · 13

bg.subtlebg.inversefg.inverseaccent.subtleaccent.defaultsuccess.subtlesuccess.defaultwarning.subtlewarning.defaultdanger.subtledanger.defaultborder.subtleradius.sm