Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Badge

A non-interactive status label. Each variant maps to a status token pair (--success/--success-bg and so on), so colour carries meaning rather than decoration. Rendering a status the data does not have is a content error, not a styling choice.

rounded-full is the one sanctioned pill in this system. Antislop R-11 bans pill controls but keeps pills for badges because colour and shape together encode real status (R-09).

React Badgelive
import { Badge } from "@/components/ui/badge";
<Badge status="success">Active</Badge>
<Badge status="warning">Pending</Badge>
<Badge status="neutral">Unset</Badge>
Terminal window
npx @glaceon/cli add badge --framework react # or svelte, solid
Variant Tokens Meaning
success --success / --success-bg Positive or completed state.
warning --warning / --warning-bg Needs attention.
accent --accent / --accent-bg In progress or highlighted.
danger --danger / --danger-bg Failure or destructive.
info --info / --info-bg Informational or neutral message.
purple --purple / --purple-bg Secondary or categorical.
neutral --neutral / --neutral-bg Neutral or unset.
pending --pending / --pending-bg Pending review.
Prop Type Default Description
status "success" | "warning" | "accent" | "danger" | "info" | "purple" | "neutral" | "pending" "neutral" Selects the token pair.
class / className string undefined Extra classes, appended last.

Colour alone does not carry the status: every badge contains text, so the meaning survives greyscale, colour-blindness, and screen readers.

The label renders at 12px (normal text), so the required contrast ratio is 4.5:1. All variants pass. The four that previously failed had their foreground token darkened in @glaceon/tokens.

Variant Ratio AA (4.5:1)
success 5.39:1 pass
warning 5.21:1 pass
accent 5.31:1 pass
danger 5.10:1 pass
info 4.67:1 pass
purple 5.03:1 pass
neutral 6.50:1 pass
pending 6.69:1 pass