Badge
A small pill for counts, statuses, and labels. Seven color intents, four sizes, plus a dot mode for compact status indicators.
Preview
<Badge value="12" /> Variants
<Badge value="Neutral" />
<Badge value="Primary" variant="primary" />
<Badge value="Secondary" variant="secondary" />
<Badge value="Success" variant="success" />
<Badge value="Warning" variant="warning" />
<Badge value="Danger" variant="danger" />
<Badge value="Info" variant="info" /> Sizes
<Badge value="Extra small" size="xs" />
<Badge value="Small" size="sm" />
<Badge value="Medium" size="md" />
<Badge value="Large" size="lg" /> Dot mode
With dot, the badge collapses to an 8px circle — useful as an inline status indicator next to a label.
<Badge dot variant="success" />
<Badge dot variant="warning" />
<Badge dot variant="danger" /> API
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | number | — | Text or count shown inside the badge. Ignored in dot mode. |
variant | 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral' | Color intent. The default, neutral, is the quiet gray-border chip for counts; ask for primary when the badge should carry the brand. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | Badge height and text size. |
dot | boolean | false | Renders a small status dot with no text. |
label | string | — | Accessible name for `dot` mode, which renders no visible text. Ignored otherwise. |
Accessibility
- Purely presentational — pair with adjacent visible text so the count or status has a label.
- Dot mode has no text content; convey its meaning through surrounding copy or an
aria-labelon the wrapper. - Color is not the only signal where possible — prefer text counts over color alone.
Theming surface
Every public token this component reads, extracted from its source at build time,
split by blast radius: the hooks that belong to this component,
then the shared and system tokens it consumes alongside everything else. The
Resolves to column walks each token's real lineage —
component → semantic → primitive → raw value — so you
can see exactly where re-pointing it lands. A spoke re-skins by overriding these in
its theme-<slug>.css; component internals are never edited. No
hook for what you need? File it with /request-lego.
Type roles it names
This component does not set a size, weight, face or tracking of its own — it names a composite, and the composite carries all five. A composite is a class rather than a token, so none of it appears in the tables below; re-theme text by re-pointing the token family, not by editing the component.
| Role | Re-point | Reach |
|---|---|---|
.typography-microcopy-2xs-strong |
| +2 more componentsesa-button-toggle, esa-chip-group |
.typography-microcopy-md-strong |
| +2 more componentsesa-button-toggle, esa-chip-group |
.typography-microcopy-sm-strong |
| +1 more componentesa-snackbar-item |
.typography-microcopy-xs-strong |
| +5 more componentsesa-button-toggle, esa-chip-group, esa-filter-dropdown, esa-sidebar-nav, esa-tab-layout |
Wired to this component
No other component reads these — re-point them and esa-badge is the
only thing that moves.
| Token | Tier | Resolves to |
|---|---|---|
--badge-bg | component | #fcfcfc via --color-background-elevation-raised → --color-gray-1 |
--badge-border-color | component | one role per property, so a theme can move the ring's weight and its colour independently. Tier 3's --focus-ring-width now reads this instead of holding a bare 2px, which is the same shape --focus-ring-color has always had (a thin tier-3 alias over a tier-2 role) — width was simply never given the tier-2 half.
*
* This role was rejected once, and the rejection is worth recording because its PREMISE was wrong rather than its reasoning. The argument against an `emphasis` width was that every 2px border in the kit is micro-geometry — spinner rings, the kbd keycap lip, a chevron. The focus ring was not in that enumeration and does not fit it: 33 components render it, more than read any other tier-3 token, and it is not micro-geometry but an accessibility affordance whose weight is a legitimate brand axis (a spoke that needs a heavier ring for contrast has to be able to reach it). It is also not a `border` in any component — every consumer paints it with `outline` or `box-shadow` — which is precisely why a survey of BORDERS missed it. The name still says `border` because tier 2 already calls the ring's colour --color-border-default-focus via --color-border-default |
--badge-text-color | component | #646464 via --color-content-default-secondary → --color-gray-11 |
Shared tokens it reads
Owned by a family or by the semantic layer. Still overridable — but scope the
override (esa-foo { --form-border-color: … }) unless you mean to move
everything that reads it. Reach says what else that is.
| Token | Reach | Resolves to |
|---|---|---|
--color-background-brand | semantic every component | #46a758 via --color-grass-9 |
--color-background-brand-hover | semantic every component | #3e9b4f via --color-grass-10 |
--color-background-brand-muted | semantic every component | #e9f6e9 via --color-grass-3 |
--color-background-utility-danger-hover | semantic every component | #641723 via --color-red-12 |
--color-background-utility-danger-muted | semantic every component | #feebec via --color-red-3 |
--color-background-utility-info-hover | semantic every component | #113264 via --color-blue-12 |
--color-background-utility-info-muted | semantic every component | #e6f4fe via --color-blue-3 |
--color-background-utility-success-hover | semantic every component | #193b2d via --color-green-12 |
--color-background-utility-success-muted | semantic every component | #e6f6eb via --color-green-3 |
--color-background-utility-warning-hover | semantic every component | #ffba18 via --color-yellow-10 |
--color-background-utility-warning-muted | semantic every component | #fff7c2 via --color-yellow-3 |
--color-border-utility-danger | semantic every component | #fdbdbe via --color-red-6 |
--color-border-utility-info | semantic every component | #acd8fc via --color-blue-6 |
--color-border-utility-success | semantic every component | #adddc0 via --color-green-6 |
--color-border-utility-warning | semantic every component | #f3d673 via --color-yellow-6 |
--color-content-default-knockout | semantic every component | #fcfcfc via --color-gray-1 |
--color-content-default-secondary | semantic every component | #646464 via --color-gray-11 |
--color-content-on-brand-muted | semantic every component | #203c25 via --color-grass-12 |
--color-content-utility-danger | semantic every component | #ce2c31 via --color-red-11 |
--color-content-utility-info | semantic every component | #0d74ce via --color-blue-11 |
--color-content-utility-success | semantic every component | #218358 via --color-green-11 |
--color-content-utility-warning | semantic every component | #ab6400 via --color-yellow-11 |
--radius-chip | semantic every component | 0.25rem via --radius-100 |
--radius-pill | semantic every component | 9999px via --radius-full |
--spacing-100 | primitive every component | 0.25rem |
--spacing-150 | primitive every component | 0.375rem |
--spacing-200 | primitive every component | 0.5rem |
--spacing-250 | primitive every component | 0.625rem |
--spacing-300 | primitive every component | 0.75rem |