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
- Container:
<div role="status" class="kit-pr-empty">, a centred column, 36px block padding, muted text; withcard, a bordered white card (--line,--r-lg). - Icon square:
IconSquareatlg(52px), theiconintone, 6px gap below. - Title: bold,
--ink. - Text (optional): muted line,
--ink-3. - Action (optional): any node, usually a
Button.
Variants
| Prop | Value | Look | When to use |
|---|---|---|---|
card | false (default) | No frame, sits inside a parent card | Inside Home's "Needs you" card, a drawer, a tab panel that is already a card |
true | Own bordered card | A tab or page section that has no card around it (Approvals tab) | |
tone | lime (default), rasp, butter, sky, lilac, mute | Square tint | Lime for done, rasp/butter for "nothing yet, make one", mute for filtered-out results |
icon | any PrIconName, default party | Square glyph | party/check for cleared queues, the object's icon (trophy, messages) for empty lists |
States
| State | How |
|---|---|
| Cleared queue | title="All clear", text="Nothing waiting here.", icon="party" or "check", tone="lime" |
| Nothing yet, with a next step | action={<Button>…</Button>} |
| No results for a filter | icon="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
cardonly 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
raspbutton, 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
ErrorStateor aBannerwith 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
--inkon white for the title and--ink-3for 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.
Related
EmptyState(kit): the brand dashboard's empty state.IconSquare: the square it draws.MiniListempty: 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.