Installation
- Tab Title
- Tab Title
Usage
Examples
Variants
Badges support semantic and decorative color variants.Sizes
Three sizes available:xs, s (default), and m.
Emphasized
UseisEmphasized for higher contrast with background color and border.
With Icons
Add leading or trailing icons. Icons only appear ons and m sizes.
With Dots
Use dots as decorative indicators. Dots are hidden if icons are present.API Reference
Badge
Color variant. Semantic:
neutral, info, warning, danger, success. Decorative: red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose.Size of the badge:
xs, s, m.When
true, applies background color and border for higher contrast.Icon element to display before the label. Only shown on
s and m sizes.Icon element to display after the label. Only shown on
s and m sizes.Show decorative dot before the label. Hidden if
leadingIcon is present.Show decorative dot after the label. Hidden if
trailingIcon is present.Explicit escape hatch for intentional structural overrides. Use with caution.
Badge label content.
Accessibility
- When a badge contains only an icon or dot without text, provide an
aria-labelon the parent element - Decorative adornments (icons, dots) are automatically hidden from screen readers when a label is present
Design Tokens
Badge uses design tokens for consistent styling:- Spacing:
--space-*for padding and gaps - Border radius:
--radius-maxfor pill shape - Colors:
--color-actions-*,--color-content-*,--color-surface-*,--color-border-* - Typography:
--font-size-*,--line-height-*,--font-weight-medium