Counter
Compact numeric count badge. Use for unread counts, selected-item totals, and other small quantity indicators — not for interactive steppers or form number inputs.
Overview
The catnip-counter custom element shows a rounded count pill.
| Prop | Role |
|---|---|
value | Number or string shown inside the badge |
appearance | primary or secondary |
disabled | Visually mutes either appearance |
size | Density s, m (default), or l |
Live example
Guidelines
When to use
- Show a compact count next to a label, tab, list row, or control (for example unread items or selected filters).
- Prefer
primarywhen the count should carry brand emphasis; usesecondaryon busy or already-coloured surfaces. Adddisabledto visually mute either appearance.
When not to use
- Do not use Counter to increment or edit a value — use Number Input or a dedicated stepper when those ship.
- Do not use Counter as a status label — use Status.
- Do not use Counter for removable or selectable tags — use Chip.
Composition
Next to a tab or list label:
html
<span>
Inbox
<catnip-counter .value="3" appearance="primary" size="s"></catnip-counter>
</span>Appearances
| Appearance | Typical use |
|---|---|
| primary | Brand-accented counts (default) |
| secondary | Neutral counts on light or coloured surfaces |
The disabled property composes with both appearances. Disabled Primary uses the disabled surface token; disabled Secondary retains its neutral surface. Both use disabled content colour. Counter itself remains presentational and non-interactive.
Sizes
| Size | Height | Typical use |
|---|---|---|
| s | 18px | Dense lists and tabs |
| m | 20px | Default inline counts |
| l | 24px | Emphasized or larger type contexts |