ChallengeCard
The Challenges tab's card: a tinted head (title, status, dates · commission) and a body by status: the reason and "Edit and resend" (rejected), when it was sent and "Edit request" (waiting), else gifts and days progress with creators, sales and commission, and "Request a change" while live. Scheduled, paused and closed (the console's states) show the progress body too, with their pill ("Scheduled", "Paused", "Ended"). The card opens the challenge drawer.
import { ChallengeCard } from '@ergasti/bricks';Examples
The four challenge states
Live, waiting for TRNDR, ended and rejected (with TRNDR's reason); each has its own action (request a change, edit request, edit and resend). The status words come from the TRNDR preset, so this example is pinned to it.
Code
import { ChallengeCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
import { useLanguage } from '@ergasti/bricks';
function States() {
const language = useLanguage();
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
{blocksData.CHALLENGES.map((c) => (
<ChallengeCard
key={c.title} title={c.title} status={c.status} tone={c.tone} dates={c.dates} commissionLabel={c.comm[language]} reason={c.reason?.[language]} sentOn={c.sentOn}
gifts={c.gifts} days={c.days} creators={c.creators} sales={c.sales} commission={c.commission} onOpen={() => {}} onAction={() => {}}
/>
))}
</div>
);
}The console's extra states
scheduled (approved, dates ahead), paused (by TRNDR) and closed (reads "Ended") draw the progress body with their pill and no action; name one in labels.action.scheduled / paused to show a button.
Code
import { ChallengeCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function ConsoleStates() {
const c = blocksData.CHALLENGES[0];
const base = { title: c.title, dates: c.dates, commissionLabel: '15% of sale', gifts: c.gifts, days: c.days, creators: c.creators, sales: c.sales, commission: c.commission, onOpen: () => {} };
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))' }}>
<ChallengeCard {...base} status="scheduled" tone="lime" gifts={{ taken: 0, total: 100 }} days={{ current: 0, total: 30 }} />
<ChallengeCard {...base} status="paused" tone="butter" />
<ChallengeCard {...base} status="closed" tone="sky" />
</div>
);
}A note above the action
note draws in the card's body before its button: the console's amendment banner ("Your change request is with TRNDR").
Code
import { Banner, ChallengeCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function WithNote() {
const c = blocksData.CHALLENGES[0];
return (
<div style={{ maxWidth: 470 }}>
<ChallengeCard title={c.title} status="live" tone={c.tone} dates={c.dates} commissionLabel="15% of sale" gifts={c.gifts} days={c.days} creators={c.creators} sales={c.sales} commission={c.commission}
onOpen={() => {}} onAction={() => {}} note={<Banner tone="info" icon="clock">Your change request (end date 5 Dec) is with TRNDR.</Banner>} />
</div>
);
}A button on a scheduled challenge
Name the action in labels.action.scheduled (or paused) when the app lets the brand change a challenge before it starts; the merge is shallow, so pass the whole action set. Leave it out and scheduled and paused cards stay without a button, as the console draws them.
Code
import { ChallengeCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
import { useLanguage } from '@ergasti/bricks';
function ScheduledAction() {
const language = useLanguage();
const c = blocksData.CHALLENGES[0];
const action = language === 'ar'
? { live: 'اطلب تعديل', waiting: 'عدّل الطلب', rejected: 'عدّل وابعت تاني', scheduled: 'اطلب تعديل' }
: { live: 'Request a change', waiting: 'Edit request', rejected: 'Edit and resend', scheduled: 'Request a change' };
return (
<div style={{ maxWidth: 470 }}>
<ChallengeCard title={c.title} status="scheduled" tone="lime" dates={c.dates} commissionLabel={c.comm[language]} gifts={{ taken: 0, total: 100 }} days={{ current: 0, total: 30 }}
creators={0} sales="0.00" commission="0.00" onOpen={() => {}} onAction={() => {}} labels={{ action }} />
</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 challengeCard, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
reasonLead | Reason from TRNDR: | السبب من TRNDR: |
waiting | Sent {d}. You'll be told when it's approved or changed. | اتبعت {d}. هنبلّغك لما يتوافق عليه أو يتعدّل. |
waitingDrawer | Sent {d}. The TRNDR team reviews it and sets the dates. | اتبعت {d}. فريق TRNDR هيراجعه ويحدد المواعيد. |
gifts | Gifts taken | الهدايا اللي اتاخدت |
days | Days | الأيام |
creators | Creators | صنّاع المحتوى |
sales | Sales | المبيعات |
commission | Commission | العمولة |
action.live | Request a change | اطلب تعديل |
action.waiting | Edit request | عدّل الطلب |
action.rejected | Edit and resend | عدّل وابعت تاني |
Design guidance
How the BRICKS design system uses ChallengeCard. Written in docs/content/components/ChallengeCard.md; the props above are read from the code, which wins where the two disagree.
A challenge card for Motivation › Challenges: a tinted head with title, status pill and "dates · commission", and a body by status (TRNDR's reason, the waiting note, or gifts / days progress with creators, sales and commission) plus the state's action; the whole card opens the challenge drawer.
It is the mock's challenge card on Brand › Motivation (P.motivation): live "Winter glow launch", waiting "Lip oil bundle push", ended "Back to campus", rejected "Ramadan preview". Challenges are run by the TRNDR team; the brand requests, edits and watches them. The console adds scheduled, paused and closed (reads "Ended"). The card is one stretched button named by the title; the action button and money "?" notes sit above it.
Anatomy
- Card:
article.kit-blk-ccard, lifts on hover. - Hit button: named by the title, opens
ChallengeDetail. - Head:
.kit-blk-ccard-h.kit-blk-tone--<tone>: h3 title +StatusPill; "1 Nov → 30 Nov 2026 · 15% of sale". - Body by status:
- rejected: warn
Banner"Reason from TRNDR: …"; - waiting: info
Banner"Sent 12 Nov 2026. You'll be told when it's approved or changed."; - others:
ProgressRowGifts taken,ProgressRowDays (ink),KeyValue columns={3}Creators / Sales / Commission.
- rejected: warn
- Note (optional): e.g. "Your change request is with TRNDR".
- Action (with
onAction): small button.
Variants
status | Pill | Body | Action |
|---|---|---|---|
'live' | Live | progress + figures | "Request a change" |
'waiting' | Waiting | sent note | "Edit request" |
'rejected' | Rejected | reason banner | "Edit and resend" |
'ended' | Ended | progress + figures | none |
'closed' | Ended | progress + figures | none |
'scheduled' | Scheduled | progress + figures | only with labels.action.scheduled |
'paused' | Paused | progress + figures | only with labels.action.paused |
tone (BlockTone) tints the head; money sets the figures' display (default compact "EGP 184.3K").
States
Hover lift; on focus-visible an inset ring (--focus-ring-inset) inside the card edge (the stretched button's); long titles wrap; note adds a line above the action.
Usage
// Brand › Motivation › Challenges
<Toolbar filters={<span className="kit-muted">Ask the TRNDR team for a challenge. They review it, may adjust it, and switch it on. Click a card for details.</span>}
actions={<Button variant="rasp" onClick={openRequest}>+ Request a challenge</Button>} />
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(360px, 1fr))' }}>
<ChallengeCard title="Winter glow launch" status="live" tone="rasp" dates="1 Nov → 30 Nov 2026" commissionLabel="15% of sale"
gifts={{ taken: 68, total: 100 }} days={{ current: 13, total: 30 }} creators={42} sales="184300.00" commission="27645.00"
onOpen={() => open('winter')} onAction={requestChange} />
<ChallengeCard title="Ramadan preview" status="rejected" tone="lilac" dates="—" commissionLabel="20% of sale"
reason="Dates overlap with Winter glow launch. Please move the start to 1 Dec."
gifts={{ taken: 0, total: 0 }} days={{ current: 0, total: 1 }} creators={0} sales="0.00" commission="0.00"
onOpen={() => open('ramadan')} onAction={editAndResend} />
</div>Where it appears
- Brand › Motivation › Challenges › challenge cards (BrandMotivation). The PR Portal's challenge card is a different block (
PrChallengeCard).
Guidelines
Do
- Pass the server's status; use
closedandscheduledonly for the console's states. - Show TRNDR's reason verbatim on rejected cards.
Don't
- Don't add your own buttons; use
onActionandlabels.action.
RTL and Arabic
- Mirrors; pips fill from the right; money LTR. Arabic: "السبب من TRNDR:", "اطلب تعديل", "عدّل الطلب", "عدّل وابعت تاني"; dates "1 نوفمبر ← 30 نوفمبر 2026".
Tokens
--card, --line, --r-lg, --rasp; tone pairs; Banner, ProgressRow, KeyValue tokens.
Accessibility
- One overlay button named by the title; the action is a separate button. Status is in words (
StatusPill). Banners carryrole="status".
Found in the source
- ARIA attributes set:
aria-label.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
ChallengeDetail(drawer),ChallengeRequestForm(request / edit),LiveChallengeCard(Home),PrChallengeCard(PR Portal).
See also: Banner · KeyValue · Button · Money · StatusPill · ProgressRow · useLanguage · useMoneyDisplay · BonusCard · BonusDetail
Source
src/blocks/motivation/ChallengeCard.tsx (line 96) on GitHub.