Skip to content
Site volume
Colourway

Components

Count

A numeric pill on the slab, capped at 99+, with its meaning in words for screen readers.

  • Experimental
  • Reading layer
  • Server component
  • Since 0.9.0
  • Press check
Import from@maxgrits/overprint-react/count
On this page

Count prints a number on a slab pill: 14 px at weight 650 with tabular figures, at least 24 by 24 px, capped at "99+". Standalone it carries a label ("3 waiting") that screen readers read in place of the bare figure. On an IconButton (count) and at the end of an AvatarGroup it is decorative, because the control's name already says it.

Example#

Look of this example

Inbox 3 waiting Archive 140 archived

Live render of examples/count/basic.tsx

Usage#

Use a count for a number that changes and needs attention: unread messages, items waiting, results. It is a slab pill with tabular figures, capped at "99+".

  • Standalone, it needs a label ("3 waiting") that screen readers read instead of the bare figure.
  • On a control, such as IconButton count or the end of an AvatarGroup, it is decorative: the control's name already says it.
  • Zero usually means no count at all.

Anatomy#

Inbox 3 waiting Archive 140 archived

The parts of examples/count/basic.tsx, numbered:
  1. PillThe slab, 24 px at least..mk-count
  2. Figure14 px, weight 650, tabular..mk-count-figure

Volume#

Reading layer: identical at every volume.

  • Quiet

    Inbox 3 waiting Archive 140 archived

    Docs, forms, legal and long reads. Flat inks, no art in motion.

  • Studio

    Inbox 3 waiting Archive 140 archived

    The site default. Art on its own plates, one display moment per view.

  • Press

    Inbox 3 waiting Archive 140 archived

    Hero moments, covers and campaigns. Halftone fields and the second ink.

  • Rave

    Inbox 3 waiting Archive 140 archived

    Launches, posters and the 404. Every ink, and the words still win.

Content#

  • The label says what is counted: "3 waiting", "140 archived".

Do and don't#

Do

Inbox 3 waiting

A count when there is something to count.

Don't

Inbox 0 waiting

A zero that asks for attention.

A count draws the eye. When there is nothing waiting, leave it out.

Accessibility#

  • The figure is hidden from assistive tech when a label is given; the words are read instead.
  • Colour never carries the count's meaning: there is no red badge. The slab pill is the same on every look.

The colour pairs it prints, with their contrast on both papers:

TextSurfaceRoleBoneNight
--mk-on-m--mk-ink-m-solidcontrol-sm 5.31:1 · Lc 79.9, passes 4.53:1 · Lc 67.8, passes
--mk-on-m--mk-ink-m-hovercontrol-sm 6.06:1 · Lc 83.1, passes 5.10:1 · Lc 71.2, passes
--mk-on-a--mk-ink-a-solidcontrol-sm 8.36:1 · Lc 60.1, passes 10.43:1 · Lc 70.0, passes
--mk-on-a--mk-ink-a-hovercontrol-sm 9.30:1 · Lc 65.2, passes 11.51:1 · Lc 75.1, passes
--mk-on-r--mk-ink-r-solidcontrol-sm 4.51:1 · Lc 75.7, passes 8.53:1 · Lc 60.1, passes
--mk-on-r--mk-ink-r-hovercontrol-sm 5.10:1 · Lc 79.6, passes 9.56:1 · Lc 65.4, passes
--mk-on-k--mk-ink-k-solidcontrol-sm 18.42:1 · Lc 107.1, passes 16.21:1 · Lc 95.1, passes
--mk-on-k--mk-ink-k-hovercontrol-sm 19.43:1 · Lc 107.6, passes 17.71:1 · Lc 101.1, passes
--mk-on-y--mk-ink-y-solidcontrol-sm 14.44:1 · Lc 89.2, passes 14.76:1 · Lc 89.4, passes
--mk-on-y--mk-ink-y-hovercontrol-sm 15.85:1 · Lc 94.9, passes 16.20:1 · Lc 95.2, passes
--mk-on-wood--mk-ink-wood-solidcontrol-sm 9.31:1 · Lc 64.8, passes 4.54:1 · Lc 70.2, passes
--mk-on-wood--mk-ink-wood-hovercontrol-sm 10.35:1 · Lc 70.1, passes 5.18:1 · Lc 73.9, passes
--mk-on-go--mk-ink-go-solidcontrol-sm 4.54:1 · Lc 76.3, passes 10.08:1 · Lc 68.6, passes
--mk-on-go--mk-ink-go-hovercontrol-sm 5.15:1 · Lc 80.3, passes 11.15:1 · Lc 73.7, passes
--mk-on-lead--mk-ink-lead-solidcontrol-sm 5.31:1 · Lc 79.9, passes 4.53:1 · Lc 67.8, passes
--mk-on-lead--mk-ink-lead-hovercontrol-sm 6.06:1 · Lc 83.1, passes 5.10:1 · Lc 71.2, passes
--mk-on-support--mk-ink-support-solidcontrol-sm 8.36:1 · Lc 60.1, passes 10.43:1 · Lc 70.0, passes
--mk-on-support--mk-ink-support-hovercontrol-sm 9.30:1 · Lc 65.2, passes 11.51:1 · Lc 75.1, passes
--mk-on-spot--mk-ink-spot-solidcontrol-sm 14.44:1 · Lc 89.2, passes 14.76:1 · Lc 89.4, passes
--mk-on-spot--mk-ink-spot-hovercontrol-sm 15.85:1 · Lc 94.9, passes 16.20:1 · Lc 95.2, passes

Process at Studio, normal contrast. Every look: the press check.

Props#

PropTypeDefaultDescription
value requirednumbernone
maxnumber99The cap; above it the pill prints "{max}+" (default 99).
labelstring | ((value: number) => string)noneWhat the number means, read by screen readers: a string or a function of the value ("3 waiting").
prefixstringnoneA sign before the figure, e.g. "+" for AvatarGroup's overflow.
decorativebooleannoneInside something that already says it: hidden from assistive tech.

Plus 278 React and DOM attributes passed through to the root element (className, ref, aria-*, event handlers and the rest). Generated from CountProps in packages/overprint-react/src/reading/count/count.tsx.

Tokens#

System tokens (8)

Its own properties (2)

  • --mk-count-leading
  • --mk-count-pad

Scanned from its CSS at build and checked against its registry entry; 3 read but not declared there.

Changelog#

Arrived in 0.9.0.

0.9.024 October 2026

  • MinorreactBreadcrumbs, Pagination (with paginationRange), Count, ProgressBar (bar, segments, indeterminate), Avatar and AvatarGroup, Tick, EmptyState, Kbd, Skeleton and Loader. IconButton's count now prints a Count at its corner. Read the whole entry