# Count

A number in a pill and nothing else: how many are in a queue, on a tab or waiting for a reply.

This is the HTML to build it with `dex.css`, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/count shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

```html
<span class="dex-count">3</span>
<span class="dex-count dex-count--muted">0</span>
<span class="dex-count dex-count--danger" aria-label="2 replies waiting">2</span>
<span class="dex-count dex-count--strong">12</span>
<span class="dex-count dex-count--sm">5</span>
```

- **Tones**: neutral by default. `--muted` at zero, so the rows that have work stand out. `--danger` for something waiting on the reader, such as replies not yet read. `--strong` sparingly.
- **Sizes**: 20px by default, and `--sm` (16px) on something small, such as a tab or a segment.
- **Digits**: one digit is a circle; more widen it. Show the full number with thousands grouped ("1,204"). Only where there's no room for more digits, show a limit with a plus ("99+").

## Rules

- A count holds a number and nothing else. A label with words in it is a badge (https://brand.meetdex.ai/components/badge.md).
- Put it next to the thing it counts, and give it an `aria-label` where the number alone wouldn't make sense read out, such as "2 replies waiting".
