Pips
The mock's .pips: round(value / max × cells) filled, clamped; max 0 → all empty. One image to AT.
import { Pips } from '@ergasti/bricks';Examples
Progress pips
A row of cells filled up to value of max; label is the accessible text ("68 of 100").
Code
import { Pips } from '@ergasti/bricks';
function Progress() {
return (
<div style={{ display: 'grid', gap: 14, maxWidth: 320 }}>
<Pips value={68} max={100} cells={25} label="68 of 100 gifts" />
<Pips value={13} max={30} cells={30} tone="ink" label="Day 13 of 30" />
<Pips value={5} max={10} cells={10} tone="rasp" label="5 of 10" />
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses Pips. Written in docs/content/components/Pips.md; the props above are read from the code, which wins where the two disagree.
A row of small cells, some filled, showing progress toward a maximum ("Day 13 of 30", "68 / 100 gifts taken"); use it under a progress label.
Pips is the mock's .pips: cells equal flex cells 14px tall with a 3px gap and 4px radius, round(value / max × cells) of them filled. The value is clamped to 0…max and a max of 0 leaves every cell empty. It is one image to assistive tech, named by the label you pass in the page language.
Anatomy
- Row (
span.kit-pips,role="img",aria-label). - Cells (
i):--trackwhen empty; filled cells (.f,data-filled) in the tone colour.
Variants
tone | Fill | When |
|---|---|---|
'rasp' (default) | --rasp | Counts: gifts taken, creators paid, wallet left |
'lime' | --chart-lime | Positive progress |
'ink' | --ink | Time: "Day 13 of 30", payout window |
cells | Mock use |
|---|---|
20 (default) | General |
25 | Gifts taken, wallet "left of last top-up" |
30 / 11 / 28 | Days of a challenge, payout window days, creators paid |
States
| State | Trigger | Look |
|---|---|---|
| Partial | 0 < value < max | Some cells filled |
| Empty | value ≤ 0 or max ≤ 0 | All --track |
| Full | value ≥ max | All filled |
Usage
The challenge progress block (as ProgressRow draws it):
<div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}><b>Gifts taken</b><span className="kit-muted">68 / 100</span></div>
<Pips value={68} max={100} cells={25} label="Gifts taken: 68 of 100" />
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 14 }}><b>Days</b><span className="kit-muted">Day 13 of 30</span></div>
<Pips value={13} max={30} cells={30} tone="ink" label="Day 13 of 30" />
</div>Wallet health:
<Pips value={42} max={100} cells={25} label="Left of your last top-up: 42%" />Where it appears
- Brand › Motivation › live challenge card ("Gifts taken", "Days") via
ProgressRow. - Brand › Payments › Payout window card ("Day 4 of 11", "Creators paid 38 / 112").
- Brand › Payments › Wallet health card ("Left of your last top-up").
- Screens: Motivation, Payments › Wallet.
Guidelines
Do
- Show the exact numbers as text next to it; pips are approximate.
- Use
tone="ink"for time and raspberry for counts, as the mock does. - Match
cellsto the unit when it is small (one cell per day).
Don't
- Don't use more than ~30 cells; they become hairlines.
- Don't omit
label: it is the only accessible text.
RTL and Arabic
- The row follows the page direction: cells fill from the right in Arabic.
- Pass the label already in Arabic.
Tokens
--track, --rasp, --chart-lime, --ink.
Accessibility
role="img"with yourlabel; the cells are not announced.- Colour is backed by the visible text label beside it.
Found in the source
- Roles in the markup:
img. - ARIA attributes set:
aria-label.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
ProgressRow: label + numbers + Pips in one block.ShareBar,UsageBar: continuous bars.
See also: Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/Pips.tsx (line 16) on GitHub.