Badge
<Badge>TailwindCSS ModulesBadges are small visual indicators used to label, categorize, or show status. Coloxo UI badges support multiple shapes (pill, rounded), 10 semantic colors, leading status dots, and dismissible actions.
npx coloxo add badge --style coloxo-cssimport { Badge } from '@coloxo/ui';Design Tokens:
1. Variant Matrix
Every color rendered across different badge types and configurations.
| Color | pill-color | badge-color | badge-modern | With dot | Dismissible |
|---|---|---|---|---|---|
| brand | Label | Label | Label | Label | Label |
| gray | Label | Label | — | Label | Label |
| error | Label | Label | — | Label | Label |
| warning | Label | Label | — | Label | Label |
| success | Label | Label | — | Label | Label |
| blue | Label | Label | — | Label | Label |
| indigo | Label | Label | — | Label | Label |
| purple | Label | Label | — | Label | Label |
| pink | Label | Label | — | Label | Label |
| orange | Label | Label | — | Label | Label |
2. Control heights
Badge dimensions match standard typography line-heights and grid increments for perfect alignment.
Sizes
size="sm"High-density tables, tags
size="md"DEFAULTStandard forms, lists
size="lg"Hero sections, titles
3. Interactive Props Configurator
dot
<Badge type="pill-color" color="brand"> Label</Badge>4. Dark theme
Badges automatically adapt to dark mode using semantic color variables.
SuccessOperationalWarningHigh CPUErrorDeployment FailedBrandBeta Feature5. Enterprise layout compositions
Demonstrating hierarchy, alignment, and data density.
Accessibility
The text content inside the badge acts as the accessible name.
Do not rely on color alone to convey status. Include text or a visible icon.
When onClose is provided, the close button is fully keyboard accessible.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| type | "pill-color" | "badge-color" | "badge-modern" | pill-color | Badge shape family. |
| color | "brand" | "gray" | "error" | "warning" | "success" | "blue" | "indigo" | "purple" | "pink" | "orange" | brand | Tone (variant prop deprecated). |
| size | "sm" | "md" | "lg" | md | Size. |
| dot | boolean | — | Leading status dot. |
| onClose | () => void | — | Dismissible badge. |