ComponentsMarkdown
Badge
Label status, category, or count in a 24px-tall inline pill with radius-xs corners. Feedback badges always carry descriptive text alongside their semantic tint.
Live example
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "neutral" | "outline" | "brand" | "info" | "success" | "warning" | "destructive" | "neutral" | Visual style and semantic feedback role. |
Sizes and tokens
| Tier / Role | Token | Value |
|---|---|---|
| Height | --space-6 | 24px |
| Corner radius | --radius-xs | 2px |
| Typography | --text-caption | 12px / 16px line height |
| Feedback tint | --<role>-subtle / --<role>-border / --<role>-text | Step 3 fill · step 6 border · step 11 text |
States
Code
import { Badge } from "@freshgemui/monoplinth";
export function Example() {
return (
<div className="flex items-center gap-2">
<Badge>Draft</Badge>
<Badge variant="success">Verified</Badge>
<Badge variant="destructive">Failed</Badge>
</div>
);
}Do and don't
Do: Always include text inside feedback badges
Pair semantic tint colors with clear status text such as Verified, Queued, or Failed so state never relies on color alone.
Don't: Render color-only status dots or interactive click handlers on Badge
Do not use empty feedback badges or attach click actions to Badge; use Button for interactive triggers.
Accessibility
- Feedback variants pair step 11
-texton step 3-subtleat>= 4.5:1contrast across all themes and modes. - Feedback badges always carry text to satisfy WCAG 1.4.1 (Use of Color).
Rationale
Restricting Badge to 24px height, 2px radius, and 12px caption text keeps status metadata scannable without competing with Button controls.