Skip to content

Badges

Draft Info Active Review Blocked New
<span class="badge">Draft</span>
<span class="badge badge-info">Info</span>
<span class="badge badge-success">Active</span>
<span class="badge badge-warning">Review</span>
<span class="badge badge-danger">Blocked</span>
<span class="badge badge-primary">New</span>
SM MD LG
<span class="badge badge-success badge-sm">SM</span>
<span class="badge badge-success">MD</span>
<span class="badge badge-success badge-lg">LG</span>
Info Active Review Blocked New
<span class="badge badge-info badge-soft">Info</span>
<span class="badge badge-success badge-soft">Active</span>
<span class="badge badge-warning badge-soft">Review</span>
<span class="badge badge-danger badge-soft">Blocked</span>
<span class="badge badge-primary badge-soft">New</span>
Passed Needs review
<span class="badge badge-success">
<i class="ti ti-circle-check" aria-hidden="true"></i>
Passed
</span>
<span class="badge badge-warning">
<i class="ti ti-alert-triangle" aria-hidden="true"></i>
Needs review
</span>
12 99+
<span class="badge badge-primary badge-sm">12</span>
<span class="badge badge-sm">99+</span>

Direction-to-tone is domain-specific — a falling error rate is good.

+12.4% -3.1%
<span class="badge badge-success badge-soft">
<i class="ti ti-trending-up" aria-hidden="true"></i>
+12.4%
</span>
<span class="badge badge-danger badge-soft">
<i class="ti ti-trending-down" aria-hidden="true"></i>
-3.1%
</span>
Digital salg
<span class="badge badge-info badge-soft">
Digital salg
<button type="button" class="badge-remove" aria-label="Remove Digital salg">
<i class="ti ti-x" aria-hidden="true"></i>
</button>
</span>

The remove button is icon-only, so it needs its own accessible name. React sets one from removeLabel; in vanilla, write the aria-label yourself.

Prop Type Default
variant "neutral" | "info" | "success" | "warning" | "danger" | "primary" "neutral"
size "sm" | "md" | "lg" "md"
soft boolean false
icon IconProp
onRemove MouseEventHandler<HTMLButtonElement>
removeLabel string "Remove"

soft gives a tinted fill; icon is the leading slot. onRemove renders the trailing remove button and takes its accessible name from removeLabel — React supplies the × glyph, vanilla supplies the icon.

Plus native <span> attributes. Badge takes no classNames — the remove button isn’t reachable from outside.

Class / var Effect
badge Inline-flex pill: 1.25rem tall, 0.5rem side padding, text-xs, full radius, neutral fill
badge-info badge-success badge-warning badge-danger Solid status fill with matching border and -content text
badge-primary Solid brand fill; no border colour
badge-soft Pair with a variant for a -muted fill and accent text. warning and primary keep the default text colour
badge-sm 1rem tall, 0.625rem text
badge-lg 1.5rem tall, text-sm
badge-remove Trailing icon button, 0.875rem square; nest it inside the badge so badge-sm/badge-lg can scale it

There is no badge-neutral or badge-md — both are the unmodified badge. A direct-child <i> or <svg> is kept from shrinking; no wrapper class needed.