Badge
Display a compact label for statuses, categories, versions, and other short pieces of metadata.
Usage
Use a badge to make short metadata easy to scan. The default badge uses the primary intent and a pill-shaped appearance.
Intents
Choose an intent based on the meaning of the label. Keep the same meaning for each color throughout the product so readers can recognize statuses without relearning them.
Primary
Use primary for featured labels, new features, or metadata that should receive the most attention.
Secondary
Use secondary for neutral metadata such as versions, categories, or supporting labels.
Success
Use success for healthy, completed, available, or verified states.
Info
Use info for informational states that do not represent success or require action.
Warning
Use warning when something needs attention but does not prevent the reader from continuing.
Danger
Use danger for failed, blocked, destructive, or security-sensitive states.
Outline
Use outline for low-emphasis metadata when a filled background would compete with nearby content.
Shape
Badges are pill-shaped by default. Set isCircle={false} for a compact rounded rectangle.
In context
Badges work best next to the item they describe. They can identify a release channel, clarify a feature state, or add severity to a callout.
Run request handlers closer to users with a globally distributed runtime.
Migrate to the replacement before upgrading.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
intent | primary | secondary | success | info | warning | danger | outline | primary | Controls the semantic color treatment. |
isCircle | boolean | true | Uses a pill shape when true and a compact rounded rectangle when false. |
className | string | Adds custom utility classes to the badge. |
The component also accepts standard HTML attributes supported by a span element.
Best practices
- Keep labels short, ideally one or two words.
- Use sentence case instead of all caps.
- Reserve
success,warning, anddangerfor states with matching meaning. - Do not rely on color alone; use a clear label such as Failed or Deprecated.
- Use a button or link when the element needs to perform an action. A badge is descriptive, not interactive.