When to use
- Status labels
- Counts
- Priority cues
- Compact metadata
Badges label compact metadata such as status, category, priority, or count. They should help scanning without becoming actions or decorative noise.
Start here before choosing examples or props. These notes explain where Badge helps, where another pattern is better, and what should stay true in product work.
import { Badge } from '@/components/ui/Badge';Renders a non-interactive labeled span. Color reinforces meaning; the label carries it.
Badge color should support the label, not carry the meaning by itself. Choose the variant by the state being labeled.
Use for low-emphasis state or category metadata.
Use for neutral progress or informational states.
Use for approved, complete, or healthy states.
Use for attention states that are not blocking yet.
Use for blocked, failed, or high-risk states.
Use badges where compact labels help users scan dense interfaces. Keep them short and close to the content they describe.
Label the current state with a word users recognize.
Pair counts with nearby context so the number has meaning.
Use priority labels sparingly and only when they affect work order.
Use neutral badges for compact classification metadata.
A badge is a compact label. Its text, color, and placement should make the state readable without adding another interaction target.
The component accepts every native HTMLSpanElement attribute on top of the design system props below.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'neutral' | Semantic color. Match the meaning of the state being labeled. |
icon | ReactNode | — | Optional leading icon. Pair with aria-hidden; never rely on the icon alone for meaning. |
Badges label status, priority, category, or count information in a compact form.
If the user can click it to change data, navigate, or filter results, use the correct interactive component.
Write labels that make sense without color, such as Active, Draft, Blocked, or Expiring soon.
Badges lose value when every row has several decorative pills competing for attention.
What Badge does not do yet, and what consumers need to compose themselves.
Agents should generate badges only for compact labels. If the pill changes something, navigates somewhere, or filters content, it is not a badge.
import { Badge } from '@/components/ui/Badge';
import { CheckCircle2 } from 'lucide-react';
<Badge variant="success" icon={<CheckCircle2 size={14} aria-hidden="true" />}>
Active
</Badge>
<Badge variant="error" aria-label="3 blocked requests">
3 blocked
</Badge>Badges label state. Controls change state. Decide by behavior first, then choose the visual treatment.