Badge

A small pill for numeric counters — unread counts, story points, +/− deltas. Use it next to a label or inside .issue-card-meta / .board-column-header. For status words use .lozenge instead; for free-text labels use .tag.

Root: .badge on <span>

Examples

Example 1
25
<span class="badge">25</span>
Example 2
8
<span class="badge badge-important">8</span>
Authoring tags — <lz-badge>
25 8

Authoring source

<lz-badge>25</lz-badge>
<lz-badge appearance="important">8</lz-badge>

Expands to

<span class="badge" data-lz="badge" data-lz-version="0.1.0">25</span>
<span class="badge badge-important" data-lz="badge" data-lz-version="0.1.0">8</span>

Authoring tags are macro-expanded to the canonical HTML above at build time (Vite plugin or lz-expand CLI) — the shipped artifact has no runtime.

Contract

Variants & modifiers

ClassAxisRules
badge-primarytoneoptional · exclusive
badge-importanttoneoptional · exclusive
badge-addedtoneoptional · exclusive
badge-removedtoneoptional · exclusive

Accessibility

The number is the accessible name. A bare number can be ambiguous to screen-reader users out of context; pair the badge with visible text, or add aria-label / visually-hidden text describing what is being counted (e.g. "3 comments").

Nesting

Allowed in:

  • inline text
  • .issue-card-meta
  • .board-column-header
  • table cells
  • buttons and nav items

Never inside (or containing):

  • .badge