Badge
FrondLiveBeta12
Usage
The import, then a use to start from. Both copy as they are.
Import
import { Badge } from "@/components/ui/Badge";Example
<Badge variant="neutral">Beta</Badge><Badge variant="outline" size="xs">12</Badge><Badge variant="success" dot>Live</Badge>When to use
Use it for
- Short, static labels: a plan, a count, a tag. One or two words.
neutraloroutlineby default. A status hue (success,warning,error,info) only when the badge is the status.dotadds a colored dot;dot="spinner"marks something in progress.
Avoid
- System state such as live, publishing or failed: use
StatusBadge, which owns the label and the copy. - Anything clickable. A badge is a label; use a
Buttonor a link. - Color for emphasis on a heading. Badges carry information.
Accessibility
Checks
- The words carry the meaning; the hue only reinforces them.
- A count reads with its noun nearby (
12 sites), not as a bare number.
API
Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.
Badge
| Prop | Values |
|---|---|
| variant | "neutral""info""success""warning""error""primary""purple""outline" |
| size | "xs""sm""md" |
| dot | "spinner" |
VariantsNeutralInfoSuccessWarningErrorVariantPrimaryPurpleOutlineWithDotWithSpinnerExtraSmallMediumAll
Keep going
- StatusBadgeSystem state: live, publishing, error… Dot carries the hue, the label carries the meaning.Fiddle
- NoteInline message with an icon: info, success, warning, error, bold.Fiddle
Color
Semantically named colors and a set of ramps for the full palette. Optimized for light and dark.