Skip to Content
BBRICKSv0.7.4
PR PortalStatus and icons

PrCountPill

A PR status that carries a number (the mock's "Pauses in 3 days" and "5 waiting" pills): the tone from the provider's statusTables.pr (the TRNDR preset's TRNDR_PR_STATUSES), the words with the number in them from here. The table's plain word (PrStatusPill pauses_in "Pauses soon") stays for places with no number.

import { PrCountPill } from '@ergasti/bricks';

Examples

Statuses with a number

pauses_in reads "Pauses in 3 days" in red (a brand wallet below zero), waiting_count "5 waiting" in lime (new creators to vet); any other status key reads "{word} · {count}". Tones come from the provider's statusTables.pr.

Code
import { PrCountPill } from '@ergasti/bricks';

function WithANumber() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      <PrCountPill status="pauses_in" count={3} />
      <PrCountPill status="pauses_in" count={1} />
      <PrCountPill status="waiting_count" count={5} />
      <PrCountPill status="live" count={2} />
    </div>
  );
}

The plain words

Without a number, the same keys are ordinary PR statuses: "Pauses soon", "Waiting", and "TRNDR-wide" (sky) for a challenge that runs on every brand.

Code
import { PrStatusPill } from '@ergasti/bricks';

function Words() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      <PrStatusPill status="pauses_in" />
      <PrStatusPill status="waiting_count" />
      <PrStatusPill status="trndr_wide" />
    </div>
  );
}

In Arabic

Days are counted the house way ("يومين", "3 أيام").

Pinned to Arabic
Code
import { PrCountPill, PrStatusPill } from '@ergasti/bricks';

function Arabic() {
  return (
    <div dir="rtl" style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      <PrCountPill status="pauses_in" count={2} language="ar" />
      <PrCountPill status="pauses_in" count={3} language="ar" />
      <PrCountPill status="waiting_count" count={5} language="ar" />
      <PrStatusPill status="trndr_wide" language="ar" />
    </div>
  );
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prCountPill, or with the component's own prop where it has one. A {name} is a value the component fills in.

prCountPill
KeyEnglishArabic
pauses_inPauses in {d}هيتوقف بعد {d}
waiting_count{n} waiting{n} مستنيين
other{word} · {n}{word} · {n}

Design guidance

How the BRICKS design system uses PrCountPill. Written in docs/content/components/PrCountPill.md; the props above are read from the code, which wins where the two disagree.

A PR status pill that carries a number: "Pauses in 3 days" (red), "5 waiting" (lime), or "{word} · {count}"; use it in task rows, nav and tabs where a status needs its count.

PrCountPill takes its tone from the provider's statusTables.pr (the TRNDR preset's TRNDR_PR_STATUSES) and writes the words with the number in them. pauses_in counts days the house way ("Pauses in 1 day", "Pauses in 3 days"; Arabic "يومين", "3 أيام"); waiting_count reads "5 waiting"; any other key reads "Live · 2". The table's plain word (PrStatusPill status="pauses_in" "Pauses soon") stays for places with no number. Added by the v3 fidelity branch.

Anatomy

  1. Pill: kit Pill (kit-chip), 12px / 700, radius 99px, no wrap, in the key's tone (mute when unknown).
  2. Text: the counted words.

Variants

statusToneText
pauses_inbad (red)Pauses in 3 days
waiting_countlime5 waiting
any other key (live, …)the key's toneLive · 2
unknown keymute{key} · {count}

States

Static.

Usage

import { PrCountPill } from '@ergasti/bricks';

export function WithANumber() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      <PrCountPill status="pauses_in" count={3} />
      <PrCountPill status="pauses_in" count={1} />
      <PrCountPill status="waiting_count" count={5} />
      <PrCountPill status="live" count={2} />
    </div>
  );
}
// Home › To review: a brand below zero, and new creators to vet
<ul className="kit-pr-queue">
  <TaskRow lead={<BrandAvatar name="Kemet Home" color="#3D5A10" />} title="Kemet Home is below zero" meta="− EGP 8,400 · day 4 of 7"
    tag={<PrCountPill status="pauses_in" count={3} />} onOpen={() => openBrand('kemet')} />
  <TaskRow lead={<IconSquare name="user" tone="lime" />} title="5 new creators waiting for vetting" meta="They can't join any brand until you approve them"
    tag={<PrCountPill status="waiting_count" count={5} />} onOpen={() => openApprovals('new')} />
</ul>

Where it appears

  • PR Portal › Home › "To review" rows ("Pauses in 3 days", "5 waiting").
  • PR Portal › nav counts and tab counts where a status has a number.
  • Dashboard screen: PrHome.

Guidelines

Do

  • Use pauses_in only for wallets below zero, counting days to the pause.
  • Keep the plain PrStatusPill where there is no number.

Don't

  • Don't put the number in a separate badge next to a PrStatusPill.

RTL and Arabic

Mirrors; Arabic counts days with the dual and plural ("هيتوقف بعد يومين"), "5 مستنيين".

Tokens

--rasp-50, --bad, --lime, --olive, and the other kit-chip tones.

Accessibility

  • Role: none; a <span> (kit-chip) with text, not focusable, outside the tab order. When it sits in a TaskRow whose whole row is one button (onOpen, no action), the button is the focus target and the pill's words are part of its accessible name.
  • Text alternative: the number is inside the words ("Pauses in 3 days", "5 waiting", "Live · 2"), so it is read in context; the tone only repeats it.
  • Changes: the pill has no live region; a new count is read when the user reaches it, not announced.
  • Contrast (12px / 700): pauses_in --bad on --rasp-50 5.5:1; waiting_count --olive on --lime 6.3:1; other keys use their status pair (for example ok 4.6:1, sky 7.0:1). All pass AA for small text.

Found in the source

  • Its tests cover: “any other key: ”; “the provider’s table gives the tone, labels.prCountPill the words”.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Pill · useBricks · useLanguage · DecisionLine · DecisionTag · DecisionTagsProvider · IconSquare

Source

src/pr/PrCountPill.tsx (line 47) on GitHub.

On this page