Components
Badge
Short static label in four tones that flags a trait or a notable state of the item next to it.
import { Badge } from "@openperf/deft";
<Badge.Root tone="danger">Expired</Badge.Root>;When to use
| Need | Component |
|---|---|
| Fixed word that sets an item apart: "You", "Demo", "Read only", "N+1" | Badge |
| Live state of an item: severity, health, enabled or disabled | Dot |
| Value taken from the data, such as an environment or a browser | Tag |
| Option the user switches on and off | Chip |
Tones
| Tone | Use |
|---|---|
neutral | Default. Traits such as "You" or "Demo". |
accent | Accent-tinted highlight. |
warning | Things to look at, such as "N+1" or a write scope. |
danger | Things that are wrong, such as an expired token or a failed delivery. |
The badge is 18px tall, stays on one line and does not shrink, so keep the label to one or two words. An icon can sit next to the text; children are spaced 4px apart.
API
Prop
Type