Malevich

Elements / Display/

Badge

Inline status/category label.

Badge

A small label for marking status, category, or count. Badges are visual atoms — they describe, they don't act.

When to use

Use a badge to call out a piece of metadata next to a heading, list item, or table row: a status (Active, Archived), a category (Beta, New), or a small count.

If the badge needs to be interactive — clickable to filter, dismissible to remove a tag — the AUTHOR wraps it in a <button>. The badge component itself stays purely visual.

Variants

Variant Class Use for
Default .badge Neutral metadata
Accent .badge.-accent Highlighted state (Beta, New)
Danger .badge.-danger Critical / error states
Warning .badge.-warning Pending / needs attention
Success .badge.-success Active / completed
Info .badge.-info Informational tags
Muted .badge.-muted Archived / disabled

Sizes

Single size for v1.0. Future versions may add -s and -l.

Anatomy

<span class="badge">Default</span>
<span class="badge -accent">Beta</span>
<span class="badge -danger">Critical</span>
<span class="badge -warning">Pending</span>
<span class="badge -success">Active</span>
<span class="badge -info">Info</span>
<span class="badge -muted">Archived</span>

<span> is the appropriate semantic element — inline text content, not a button or link.

Tokens used

Tier 3 (component-specific): none. Badge consumes semantic tokens directly — the relationship is canonical, no per-component refinement needed.

Accessibility

Edge cases

Do

Don't

Related