Skip to Content
BBRICKSv0.7.4
PR PortalStatus and icons

PrEmpty

The PR mock's .empty: a 52px tinted icon square (the party popper on a cleared queue), a bold line and a muted one, and an optional action ("Clear filters", "Back to challenges"). A status region, so a queue emptied by the last approval is announced.

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

Examples

Empty states

An icon, a title and a sentence; card puts it in a card, action offers the next step.

Code
import { Button, PrEmpty } from '@ergasti/bricks';

function Empty() {
  return (
    <div style={{ display: 'grid', gap: 16 }}>
      <PrEmpty card title="All clear" text="Nothing waiting here." icon="check" tone="lime" />
      <PrEmpty title="No messages yet" text="Messages you send to creators show up here." icon="messages" tone="sky" action={<Button variant="rasp">New message</Button>} />
    </div>
  );
}

Props

Prop

Type

Design guidance

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

The PR Portal's empty state: a large tinted icon square, a bold line, a muted line and an optional action; use it when a queue, list or tab has nothing to show.

PrEmpty is the PR mock's .empty. It tells PR that a queue is done ("All clear · Nothing waiting here.") or that a list has nothing yet, and offers the next step when there is one ("New challenge", "Clear filters"). It is a status region, so a queue emptied by the last approval is announced. In the mock it closes the Home "Needs you" card and the Approvals tabs.

Anatomy

  1. Container: <div role="status" class="kit-pr-empty">, a centred column, 36px block padding, muted text; with card, a bordered white card (--line, --r-lg).
  2. Icon square: IconSquare at lg (52px), the icon in tone, 6px gap below.
  3. Title: bold, --ink.
  4. Text (optional): muted line, --ink-3.
  5. Action (optional): any node, usually a Button.

Variants

PropValueLookWhen to use
cardfalse (default)No frame, sits inside a parent cardInside Home's "Needs you" card, a drawer, a tab panel that is already a card
trueOwn bordered cardA tab or page section that has no card around it (Approvals tab)
tonelime (default), rasp, butter, sky, lilac, muteSquare tintLime for done, rasp/butter for "nothing yet, make one", mute for filtered-out results
iconany PrIconName, default partySquare glyphparty/check for cleared queues, the object's icon (trophy, messages) for empty lists

States

StateHow
Cleared queuetitle="All clear", text="Nothing waiting here.", icon="party" or "check", tone="lime"
Nothing yet, with a next stepaction={<Button>…</Button>}
No results for a filtericon="x", tone="mute", action = "Clear filters"

Usage

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

<PrEmpty title="All clear" text="Nothing waiting here." icon="check" card />
// Approvals: the join requests tab after the last approval
{rows.length === 0 ? (
  <PrEmpty title="All clear" text="Nothing waiting here." card />
) : (
  <DataTable label="Join requests" rows={rows} columns={joinRequestColumns('en', { onApprove, onReject })} rowKey={(r) => r.id} />
)}
// Challenges tab with nothing yet, and the next step
<PrEmpty
  title="No challenges yet"
  text="Create one for a brand."
  icon="trophy"
  tone="rasp"
  action={<Button variant="rasp" onClick={newChallenge}>New challenge</Button>}
/>

Where it appears

  • PR Portal › Home › "Needs you" card, when nothing is waiting (inline, card={false}).
  • PR Portal › Approvals › Join requests and New creators tabs, when emptied (card).
  • PR Portal › Affiliate programs › Challenges, and filtered lists with no results.
  • Dashboard screens: PrHome, PrApprovals.

Guidelines

Do

  • Say what is empty and, when PR can act, what to do next, in one short line each.
  • Use card only where no card surrounds it.
  • Keep the celebration (party, lime) for queues PR has cleared, not for lists that never had items.
  • Make a create action ("New challenge", "New message") a rasp button, as the PR Portal does for creating and sending.

Don't

  • Don't show it while data is loading: show the table's or card's loading state instead.
  • Don't put more than one action in it.
  • Don't use it for errors: use ErrorState or a Banner with retry.

RTL and Arabic

Centred, so nothing visibly mirrors. Arabic copy from the gallery: "كله تمام" / "مفيش حاجة مستنية هنا.". Cairo's taller line height applies through the provider's language.

Tokens

--ink, --ink-3, --line, --card, --r-lg, plus IconSquare's tone tokens and --radius-lg.

Accessibility

  • role="status" (a polite live region). It mounts together with its text, and a live region added with its content is often not read, so do not rely on it to announce a cleared queue: announce the last approval with a toast (ToastRegion) and let the empty state be read when the user reaches it.
  • The icon square is aria-hidden; the title carries the meaning.
  • Text is --ink on white for the title and --ink-3 for the line.

Found in the source

  • Roles in the markup: status.

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

  • EmptyState (kit): the brand dashboard's empty state.
  • IconSquare: the square it draws.
  • MiniList empty: a one-line muted empty for short lists inside cards.

See also: Button · DecisionLine · DecisionTag · DecisionTagsProvider

Source

src/pr/PrEmpty.tsx (line 10) on GitHub.

On this page