Badge
stableA small visual indicator for statuses, counts and labels.
Basic usage
DefaultSecondarySuccessWarningDestructive
Examples
Status indicators
Show all five semantic variants to communicate pipeline or task status.
DefaultDraftPublishedPendingFailed
Status variants
Badges cover neutral labels, success, warning, destructive and outline statuses.
DefaultSecondaryOutlineHealthyReviewBlocked
Color prop
The color prop applies semantic tints to both filled and outline shapes.
primarysecondaryerrorwarninginfosuccess
primarysecondaryerrorwarninginfosuccess
Features
- Six variants.
- Supports `asChild`.
Installation
bash
pnpm dlx structyl add badgeAPI Reference
Badge
A small status descriptor. Renders a span by default.
| Prop | Type | Default |
|---|---|---|
| variant | 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning'Visual style. | 'default' |
| asChild | booleanMerge props onto the immediate child instead of rendering a default element. | false |
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |