Counter
A counter is a small number on or beside a control that says how many items wait there. It appears only when there is something to act on.
What it is
When to use it
Use a counter for a number someone can bring down by acting, such as unread notifications or the new applications waiting in a view.
Leave it off totals that only describe, such as the number of candidates on a board. Navigation pages carry no counters, since nothing on them waits to be read.
Anatomy
On an icon button the counter sits over the top end corner, so the icon stays whole. Beside a word it follows the word.
- Height
- 17 px
- Minimum width
- 17 px
- Padding at the sides
- 4 px
- --space-1
- Corner radius
- 6 px
- --radius-md
- Numerals
- 10.5 px, weight 700, tabular
- Position on a button
- 6 px above its top, 4 px past its end
- Ring on a button
- 2 px in the button's resting fill
- Space after a label
- 8 px
- --space-2
Tones
Red is for items that need attention, such as unread notifications, and stays the same red in both themes. On a total that can wait it stops meaning attention. Blue says something arrived since the view was last opened, and turns gray once it is. Gray is a plain count.
- Attention
- New
- Plain
- Attention
- New
- Plain
- Attention
- red fill, white numerals
- --badge-alert
- New
- blue tint, blue numerals
- --track-tint
- Plain
- gray chip, gray numerals
- --chip-fill
Numbers
Up to 999 the counter shows the exact number. From 1,000 it shows thousands with one decimal, rounded down so it does not claim more than there is: 1.9k for 1,999. From 10,000 it shows 10k+. At zero the counter disappears.
- 7
- 999
- 1,999
- 12,480
Accessibility
Screen readers skip the number itself. The control's name carries it together with what it counts: Applications, 12 in this view, new since you last opened it. A bare number read after a word tells the listener nothing.
The counter takes no focus of its own. The control it belongs to does. It grows in over 150 milliseconds, and appears without motion for anyone who has asked for reduced motion.