Skip to Content
BBRICKSv0.7.4
KitPrimitives

Pill

The mock's .pill: 12/700, 4 10, radius 99. Always text: the tone only repeats what the words say.

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

Examples

Tones

The mock's seven pill colours; the tone is the meaning (ok, warn, bad…), the children are the words.

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

function Tones() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      {(['ok', 'warn', 'bad', 'mute', 'sky', 'lime', 'lilac'] as const).map((tone) => <Pill key={tone} tone={tone}>{tone}</Pill>)}
    </div>
  );
}

Props

Prop

Type

Design guidance

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

A small rounded label in one of seven tones; use it for short status-like words when no status table applies.

Pill is the mock's .pill: 12px 700 text, padding 4px 10px, a 99px radius, no wrap. The tone only repeats what the words say, so the text must carry the meaning. StatusPill, PrStatusPill, TierChip and other domain pills are built on it; use Pill directly for one-off labels ("No gifts left", "Draft", a count).

Anatomy

  1. Pill (span.kit-chip.kit-chip--{tone}): inline-flex, 6px gap for an icon child.
  2. Content: children.

Variants

toneLookWhen
'ok'--ok-bg / --ok greenActive, paid, approved
'warn'--butter / --butter-inkPending, waiting
'bad'--rasp-50 / --badRejected, failed, ended badly
'mute'--soft / --ink-2Neutral, draft, ended
'sky'--sky / --sky-inkInformational, scheduled
'lime'--lime / --oliveLive, highlighted
'lilac'--lilac / --lilac-inkGroups, categories

States

StateTriggerLook
Default—Tinted pill
Long textlong childrenStays on one line (nowrap): keep it to 1–3 words

Usage

<Pill tone="mute">No gifts left</Pill>
<Pill tone="lime">Live</Pill>

In a gift stock fact row:

<KeyValue items={[
  { key: 'left', label: 'Gifts left', value: stock > 0 ? String(stock) : <Pill tone="bad">No gifts left</Pill> },
]} />

Where it appears

  • PR Portal › Brands › Brand detail › gift stock card ("No gifts left"), Affiliate programs › Challenges cards, Activity log areas, count pills. FraudSignalPill builds on it in a library-only screen (not in the v3 mock).
  • Brand › hero card chips; empty views.
  • Screens: PR · Brand, PR · Affiliate programs, Home.

Guidelines

Do

  • Use StatusPill when the value comes from a status table, so labels and tones stay consistent.
  • Keep text to a few words.

Don't

  • Don't rely on the tone alone; the words must say it.
  • Don't make it clickable; use FilterChips or Segmented for choices.

RTL and Arabic

  • --lh-ar sets the Arabic line height (default 1.45) so Cairo glyphs are not clipped.

Tokens

--ok-bg, --ok, --butter, --butter-ink, --rasp-50, --bad, --soft, --ink-2, --sky, --sky-ink, --lime, --olive, --lilac, --lilac-ink, --lh-ar.

Accessibility

  • Plain text in a span; read inline.
  • Tone pairs meet text contrast on their tint.

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

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/Pill.tsx (line 6) on GitHub.

On this page