docs / core / badge
Badge
the status of the thing it sits on. six semantic tones as soft pills, a mono variant for versions and keys, and a pulsing live state. it labels, it never clicks; a clickable pill is Chip.
intensity · recedesrsc · server
provenance
shaped from sisu-pluslayer
core / primitivesintensity
recedes · safe anywhere, including dense surfacescomposition
sits in Card headers, table rows, list items, next to a titlemono for machine values: versions, ids, env namesno onClick, no dismiss. interaction makes it a Chipnot a counter on an icon. that is NotificationBadgea11y
plain text in aspan · the live dot is aria-hiddenjest-axedependencies
class-variance-authoritylive demo · try it out
Passing
customize
tonesemantic color role
labelthe text inside
monouppercase tag for versions, keys
livepulsing green, overrides tone
usage
import { Badge } from "@usva-ui/react/primitives/badge";
<Badge tone="success">Passing</Badge>props
| prop | type | default | notes |
|---|---|---|---|
| tone | "neutral" | "accent" | "accent-alt" | "success" | "warning" | "danger" | "neutral" | semantic color role, rendered as a soft pill. |
| mono | boolean | false | an uppercase monospace tag, for versions, keys and metadata. |
| live | boolean | — | the live green with a pulsing dot. overrides tone. |
get it
bun add @usva-ui/reactusage
import { Badge } from "@usva-ui/react/primitives/badge";
<Badge tone="accent">New</Badge>
<Badge tone="success">Passing</Badge>
<Badge tone="accent-alt" mono>v1.0.0</Badge>