Badge
Presentational badge: tone (neutral, info, success, warning, destructive) for meaning, variant (default, secondary, outline) for an untoned look. Tone values passed as variant still work but are deprecated.
Example
DefaultSecondaryOutlineDraftPreviewReadyBuildingFailedDesign
badge-demo.tsxCopy code
Installation
Copy code
Brings alongtone
npm packages
class-variance-authority@0.7.1Usage
ImportCopy code
API reference
Badge
| Prop | Type | Default |
|---|---|---|
toneWhat the badge means; takes precedence over `variant`. | Tone | – |
variantThe look of a badge without a tone. `success`, `warning`, `info` and `destructive` still work but are deprecated: use `tone`. | "default" | "secondary" | "outline" | DeprecatedBadgeTone | – |
Also takes <span> attributes and render.
Other exports
badgeVariantstype BadgePropsAccessibility
- Presentational text: the tone adds colour, so keep the word meaningful.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.