Visible status or classification text.
Primitive contract
Badge
Names a compact status or classification with visible text and supporting tone while preserving the v0.0.2 API.
Short status or classification label · @sanchika/primitivesPurpose and semantics
Names a compact status or classification with visible text and supporting tone while preserving the v0.0.2 API.
Recommended semantic: Use span or another phrasing element; Badge adds no live-region behavior.
Anatomy
Finite variants and important states
- Variant · tone
- neutral, success, warning, danger, info
- Variant · size
- sm, md
- Required states
- default
- Class hooks
.sk-badge · .sk-tone-neutral · .sk-tone-success · .sk-tone-warning · .sk-tone-danger · .sk-tone-info · .sk-size-sm · .sk-size-md
Composed synthetic exemplar
Rendered state matrix
Badge: 1 required state
Each specimen starts from the package-owned example and contract state inventory. Simulated pointer and focus frames are labelled; consumers still verify real interaction in context.
CA review needed
Accessibility and consumer responsibility
- Badge adds no keyboard behavior.
- Status meaning must be present in text
- Consumers add live-region semantics only when a real state update requires them
- Supply visible status text
- Announce dynamic updates when required
- Long labels wrap instead of overflowing.
No override is needed.
- Text and boundary remain visible with system colors.
Compact API reference
- Package
@sanchika/primitives- CSS
@sanchika/primitives/styles.css- Contract
primitiveSpecs.find((contract) => contract.name === "Badge")- Primary class
.sk-badge