Components / feedback

Badge

A word or two that names a state — Live, Draft, Parked — and never acts.

Rendered from the package · open on its own

Summary

A word or two that names a state — Live, Draft, Parked — and never acts.

APG patternnone
Built onnative elements
Statusself-tested
Since0.7.0
<Badge intent="positive" status>Live</Badge>
<Badge intent="warning" emphasis="solid">Needs review</Badge>
<Badge intent="negative" status label="Failing" />

The third form draws the dot alone. The label is still in the DOM, hidden, so a screen reader hears what the dot means.

Anatomy

A <span data-se="badge" data-se-text="caption"> holding the words — the type role is part of the anatomy, as Button's ui is, so a consumer writing the markup by hand writes it too. With status, a status part — the dot — sits before them. In the dot-only form the words move into sr, and the root carries data-status-only so the CSS can collapse the box to the dot.

PartElementRequired
sr<span>no
status<span>no
<span data-se="badge" data-se-text="caption" data-intent="positive" data-emphasis="outline">
  <span data-part="status" aria-hidden="true"></span>
  Live
</span>

<span data-se="badge" data-se-text="caption" data-intent="negative" data-status-only>
  <span data-part="status" aria-hidden="true"></span>
  <span data-part="sr">Failing</span>
</span>

status is the name because dot is taken: Carousel owns dot, and the two are not the same part. A carousel dot is a button; this is a mark.

Properties

PropertyValuesDefaultWhat it does
intentaccent · positive · negative · warning · neutralneutralWhat the state means. It sets the color of the box and the dot, and never stands alone — the words carry the meaning, and the dot-only form keeps them for the screen reader.
emphasissolid · outlineoutlineHow loudly to say it. Outline for a state among many on a busy screen; solid for the one state the reader must not miss. There is no transparent: a badge with no box is a word, and a word takes a type role.
sizesm · mdmdsm is a tag: a word on an item, such as a category on a row, one text step smaller than a status. md, the default, is a status. Use sm with the neutral outline.
statusbooleannoneDraws the dot before the words. Pass it when the state is one of a set the reader scans — a list of deploys, a board of items — so the eye finds the color before the word.
labelstringnoneWhat a screen reader hears in the dot-only form, which is the only time it renders. Pass status and label with no children and the box collapses to the dot; the words stay in the DOM, hidden. Without it a dot-only badge renders nothing — even under aria-hidden: a mark that means a state has a name whether or not this instance is announced, and the name is what the binding refuses to leave out.
childrenReact.ReactNodenoneThe visible words. One or two; a badge that needs a sentence is an Alert.

States

_None. Rest is the only condition it has._

A badge reports a state; it does not have one. Disabled, pressed and selected belong to the thing it sits on.

Behavior

None. It renders and stays put. A state that changes while the reader watches changes the words, not the component — and if the change itself needs announcing, that is an Alert or a Toast.

Accessibility

The words carry the meaning, every time. Color is the second channel, never the only one. Roughly one man in twelve cannot separate positive from negative by color, and a screen reader cannot see either.

The dot-only form hides the words; it does not drop them. label goes into data-part="sr", so the dot reads as its word. A dot with no label is a badge with no name, and the binding renders nothing — even when the caller passes aria-hidden: a mark that means a state has a name whether or not this instance is announced, and the name is what the binding refuses to leave out. Hiding a badge from the tree is the caller's call; shipping one with no name is not on offer.

Not a live region. A badge changing from Draft to Live is not announced. Announcing it is the caller's decision and the caller's Alert.

Keyboard

None of its own. It is not focusable and takes no keys.

Roles, states and properties

AttributeSet by
aria-hiddenalways true

Focus

Never takes focus. A badge inside a button or a link is part of that control's name.

Screen reader

Not recorded as verified. Stage 4 of the readiness ladder — driving each component with VoiceOver and NVDA — is unstarted across the package, and no component should claim otherwise until docs/journal/ records the session that did it.

Contrast and target size

npm run check:contrast audits every color pair this component uses across all four skins, light and dark, and fails the build on a shortfall. Two waivers are on the record in docs/audit/DEFERRED.md.

It sets no target size of its own; anything interactive inside it brings its own.

Tested

  • test/apg/accordion-adornments.test.jsx
  • test/apg/badge-chip.test.jsx
  • test/apg/stat-prose.test.jsx
  • test/browser/badge-chip.spec.mjs
  • test/browser/intent-tint-and-track-edge.spec.mjs

Known gaps

_No upstream requirement is recorded as not applicable._

Appearance

The words take the caption role at the label weight: xs, medium, in sentence case, as they are written. The pill pads half a space step above and below, so it stands no taller than a line of body text, and its edge is drawn inside the box, so an edged badge and one with no edge are the same height. The neutral outline is the quiet one: muted words inside a control's edge, with no fill. The small badge is a tag: one text step down, --se-text-2xs, so it stands shorter than a status beside it. Use it with the neutral outline. The dot is --se-dot-size across — the one size every dot in the system shares, Rows' included — and takes the intent color, except the neutral dot, which is muted: a neutral dot means no state known, and near-black says the opposite. On a solid fill the dot is drawn in the fill's own label color whatever the intent. An outline with an intent is the intent's soft fill with a hairline of its line color; solid is the intent fill with --se-text-on-intent.

TokenUsed for
--se-accentintent
--se-bgline, soft
--se-border-strongbox-shadow
--se-border-widthbox-shadow
--se-dot-sizeblock-size, inline-size
--se-mix-lineline
--se-mix-softsoft
--se-negativeintent
--se-negative-lineline
--se-negative-softsoft
--se-positiveintent
--se-positive-lineline
--se-positive-softsoft
--se-radius-pillborder-radius
--se-space-1gap, padding
--se-space-2padding
--se-textintent
--se-text-2xsfont-size
--se-text-mutedbackground, color
--se-text-on-intentcolor
--se-warningintent
--se-warning-lineline
--se-warning-softsoft
--se-weight-mediumfont-weight

Its own custom property: --se-_intent, set by data-intent the way Alert and Button set theirs.

Motion

None. A badge appears with the row it sits in.

Content

One or two words, a state, sentence case. Live, Draft, Needs review, Parked. Not Status: live, and not a sentence — a sentence is an Alert.

The word is the state the reader would say. Failing is what a deploy is; Error is what the system had.

Two examples: Live on a published portfolio, Carried on a block set aside at close.

Usage

Badge names; Chip acts. The two were one component in the apps — the builder's .cc-chip did both jobs across nine files — and the review split them by that line. Anything that toggles, filters or can be removed is a Chip.

One channel for one meaning. Do not put a badge's intent on a chip or a button beside it, and do not stack two badges to say one thing. If a row needs a status and a count, the count is text.

Dot-only where there is no room, and nowhere else. A table cell of dots is scannable; a dot on its own line is a riddle. The hidden label is for the screen reader, not for the sighted reader to hover for.

When not to use it. For a number — a count, a total — use Stat, or a plain span. For a message with a verb in it, Alert. For a filter the reader turns on and off, Chip.

Notes

Named Badge, not Tag or StatusDot (15 Oct 2026, both plans). The apps had three names for two things. Badge is the static label; its status part absorbs the hand-made dots — thirteen in the builder, more in hosting-event and the studio — that each carried its own size and color.

status, not dot, for the part. Carousel owns dot, and the vocabulary rule says one word means one part. A carousel dot is a button that picks a slide; this dot is a mark that means a state.

No size axis, and one dot size (ruled 15 Oct 2026, from the builder's adoption). The builder drew its card status dots at 12px beside a status heading and its list dots at 8px. The dot is --se-dot-size in every place the system draws one — Rows' meta, this badge — because a dot is a glance mark that sits in a line of text, and a mark that scales with the heading it sits beside is a different thing: that place takes the badge with its words, which has the heading's weight, or Stat. A second dot size would be a second rule for where the eye lands in a list, and there is one.

The neutral dot is muted (ruled the same day). A neutral badge's words were --se-text then, because words have a contrast floor to meet; its dot has none, and a near-black dot beside Unknown read as the strongest state on the board. --se-text-muted says what neutral means. On a solid fill the rule does not apply: there the dot takes the fill's label color, as every intent's does.

No transparent emphasis. Recorded above under Properties. A boxless badge would be the eyebrow type role with a color, and the type layer refuses to pair the two for a reason that holds here too.

Sentence case, and no taller than its line (14 Nov 2026). The words took the eyebrow role, so every badge was tracked capitals in a pill that padded a whole space step, and stood taller than the title it sat beside. Two of the owner's own products draw their status pills in sentence case at the label weight. The words now take the caption role, the padding is half a step, and the edge is drawn inside the box.

The neutral outline's words are muted (14 Nov 2026), which changes the ruling above. They were --se-text on a gray fill, the darkest thing on a row that was only naming a tag. --se-text-muted meets the contrast floor on every surface in every skin, which check:contrast holds, so the floor the first ruling protected is still met. A solid neutral badge is unchanged.

A small size, for a tag (14 Nov 2026), which changes the ruling of 15 Oct. That ruling refused a size axis, and its reason was the dot: a dot is one size wherever the system draws one, and that stands. What the owner added is a second size of the words. size="sm" is one text step down, for a word on an item that names it and claims no state: a category on a row. A status stays the default size.