Skip to content
GitHub (opens in a new tab)

Count

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

stableAtomcontracts/count.json

Preview

Count

Small number badge for unread or pending counts. Not Badge. Not a button. Counts above max show as max+.

Master

Three unread, info intent, md. Variants shows intents, subtle, sizes and disabled.

3 unread messages

Usage

Pass label so screen readers hear 3 unread messages, not just 3. Badge is for words.

Do's

  • Which mark: Count is how many (a number only, neutral unless action is due). If it is a number, it is a Count, never a Badge.
  • Unread or pending counts on nav items, tabs, and buttons
  • A total next to a section title
  • FilterButton applied-value counts
  • Overflow +N in a picker, like MultiSelect maxVisible (prefix "+")

Don'ts

  • Words or status labels — use Badge
  • Money or metric changes — use Delta
  • A clickable control — use Button
  • A KPI or metric tile — use Scorecard
<Count
  count={3}
  label="unread messages"
/>

When to use

  • Which mark: Count is how many (a number only, neutral unless action is due). If it is a number, it is a Count, never a Badge.
  • Unread or pending counts on nav items, tabs, and buttons
  • A total next to a section title
  • FilterButton applied-value counts
  • Overflow +N in a picker, like MultiSelect maxVisible (prefix "+")

When not to use

  • Words or status labels — use Badge
  • Money or metric changes — use Delta
  • A clickable control — use Button
  • A KPI or metric tile — use Scorecard

What an agent reads

import { Count } from "agentic-ds-kit";
must
  • The visible number is hidden from screen readers; they hear the full count plus label instead, like 150 unread messages
  • Intent is never the only signal; the number carries the meaning
  • disabled sets aria-disabled
defaults
  • intent info
  • size md
  • subtle false
  • disabled false
  • max 99
stops if
  • Do not invent a local counter or notification dot
  • Do not put words in a Count — use Badge
  • Do not type a + into label or wrap the number in text; use prefix="+" for overflow
  • Do not use Count as a button
  • Do not show more than one danger Count in a row
  • Do not use raw hex or primitive --color-* ramps

From contracts/count.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
countnumberYes——
intentinfo | danger | neutralNoinfoinfo is the default brand (ink) fill. danger for items that need action now. neutral for plain totals.
sizesm | md | lgNomdHeights space-4 / space-5 / space-6. sm and md are the standard counts; lg is for larger controls.
subtlebooleanNofalseLighter fill. Defined for info, neutral, and danger.
disabledbooleanNofalseMuted fill and faint text.
maxnumberNo99Above max the Count shows max+.
labelstringNo—What is counted, for screen readers, like unread messages.
prefix+No—Shown before the number for an overflow count, like +3 in MultiSelect. Visual only; screen readers hear the count and label (3 more selected).
  • Component
    →

    Badge

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

  • Component
    →

    Delta

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

  • Component
    →

    Button

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

  • Component
    →

    Scorecard

    one KPI with label, value, optional delta/trend/hint/badge