Skip to content
GitHub (opens in a new tab)

Badge

Compact read-only status or category pill set by the system.

stableAtomcontracts/badge.json

Preview

Badges

Status the system sets. sm 20 and md 24, no border, 4px corner, optional tone icon. Not a number (Count), not a change (Delta), not a person (Avatar), not a button.

Master

A soft success Badge at md with its tone icon. Variants shows every appearance and tone.

Active

Usage

Badge for status; Avatar for people; Button for actions. Removable only for dismissible filters; user-managed labels use Tag. tone="brand" is an alias of primary.

Do's

  • Which mark: Badge is status the system sets (tone icon and word, subtle fill, 2px corner). If it is a number, it is never a Badge.
  • Status badges on table rows or cards
  • Category markers set by the system (user-managed labels use Tag)
  • Leading marker inside an announcement chip (Link variant chip, Badge size md); the Link is the only control

Don'ts

  • Money or metric changes — use Delta
  • Counts and +N overflow — use Count
  • Primary actions — use Button
  • Clickable navigation — use SideNav (product) or DocsNav (docs/catalog) links (a Badge inside a Link chip is fine; the Link is the control)
  • People or faces — use Avatar
  • Long sentences — use body text
  • Labels the user applies, removes, or selects — use Tag

Which mark to use

Badge is status. Tag is a label the user adds. Count is how many. Delta is how a value moved. Avatar is a person or an organisation. If it is a number, it is never a Badge.

Badge or Tag?

Badge is read-only status or category the system sets, like Paid, Overdue, or Beta. Tag is a label the user applies or manages: filter chips, keywords, assigned people. If the user can remove or select it, use Tag.

<Badge
  appearance="soft"
  tone="success"
  size="md"
  icon="CircleCheck"
>
  Active
</Badge>

When to use

  • Which mark: Badge is status the system sets (tone icon and word, subtle fill, 2px corner). If it is a number, it is never a Badge.
  • Status badges on table rows or cards
  • Category markers set by the system (user-managed labels use Tag)
  • Leading marker inside an announcement chip (Link variant chip, Badge size md); the Link is the only control

When not to use

  • Money or metric changes — use Delta
  • Counts and +N overflow — use Count
  • Primary actions — use Button
  • Clickable navigation — use SideNav (product) or DocsNav (docs/catalog) links (a Badge inside a Link chip is fine; the Link is the control)
  • People or faces — use Avatar
  • Long sentences — use body text
  • Labels the user applies, removes, or selects — use Tag

What an agent reads

import { Badge } from "agentic-ds-kit";
must
  • Text content must be readable
  • The tone icon is aria-hidden and never the only signal; the word says the status
  • disabled sets aria-disabled and prevents interaction
  • When removable, the X control is a button with aria-label Remove {children}
  • If removable and disabled, the remove control does not fire
  • Remove control shows a focus-visible ring using --border-focus
  • built-in labels (remove) come from KitLabelsProvider; English by default
  • A text badge crossfades through kit BlurCrossfade when its words, icon or tone change, and its width glides from the old label to the new one on the same enter timing; the outgoing words take no width and are aria-hidden while they leave. A resting badge renders plain. Under prefers-reduced-motion the label swaps at once with no width glide
defaults
  • appearance soft
  • tone neutral
  • size md
  • removable false
  • disabled false
stops if
  • Do not invent a local Badge; for user-managed labels use kit Tag
  • Do not put numbers or money changes in a Badge — use Count or Delta
  • Do not use raw hex
  • Do not use Badge as a button except the remove control

From contracts/badge.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
childrenstringYes——
appearancesoft | tint | solid | outlineNosoftsoft is the subtle look (default) for status in tables and lists. solid fills use the tone's fg ink token for the one mark that must stand out. outline is a hairline.
toneenumNoneutralbrand is an alias of primary. highlight is a gold marker, not a warning. neutral | primary | brand | success | warning | danger | info | highlight
sizesm | md | lgNomdHeights sm 20 (space-5) and md 24 (space-6) share a row with Count; lg 28. No border, so the height is exact. Radius --radius-control-sm.
iconKitIconNo—Leading tone icon, aria-hidden; the word carries the meaning. Suggested: success CircleCheck (Paid), danger CircleX (Overdue), warning TriangleAlert (Due soon), info Info (Sent) or Clock (Invited), neutral Circle (Draft). Leave it off for plain role labels (Admin, Member).
removablebooleanNofalse—
disabledbooleanNofalse—
onRemovefunctionNo—used when removable. Kept for dismissible filters; prefer kit Tag for user-removable labels
  • Component
    →

    Delta

    How a value moved: an arrow and the signed change in success, danger or neutral text, with no fill.

  • Component
    →

    Count

    Small number badge for counts, like unread items on a nav link or tab.

  • Component
    →

    Button

    Clickable action control with appearance × mode (plus an optional flat set) and a fixed set of sizes.

  • Component
    →

    SideNav

    Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows).