Skip to Content
BBRICKSv0.7.4
KitPrimitives

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

  1. Row (span.kit-pips, role="img", aria-label).
  2. Cells (i): --track when empty; filled cells (.f, data-filled) in the tone colour.

Variants

toneFillWhen
'rasp' (default)--raspCounts: gifts taken, creators paid, wallet left
'lime'--chart-limePositive progress
'ink'--inkTime: "Day 13 of 30", payout window
cellsMock use
20 (default)General
25Gifts taken, wallet "left of last top-up"
30 / 11 / 28Days of a challenge, payout window days, creators paid

States

StateTriggerLook
Partial0 < value < maxSome cells filled
Emptyvalue ≤ 0 or max ≤ 0All --track
Fullvalue ≥ maxAll 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 cells to 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 your label; 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.

See also: Avatar · AvatarStack · Button · ButtonLink

Source

src/kit/primitives/Pips.tsx (line 16) on GitHub.

On this page