Skip to Content
BBRICKSv0.7.4
BlocksMotivation

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.

Pinned to TRNDR preset
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.

Pinned to TRNDR preset
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").

Pinned to TRNDR preset
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.

Pinned to TRNDR preset
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.

challengeCard
KeyEnglishArabic
reasonLeadReason from TRNDR:السبب من TRNDR:
waitingSent {d}. You'll be told when it's approved or changed.اتبعت {d}. هنبلّغك لما يتوافق عليه أو يتعدّل.
waitingDrawerSent {d}. The TRNDR team reviews it and sets the dates.اتبعت {d}. فريق TRNDR هيراجعه ويحدد المواعيد.
giftsGifts takenالهدايا اللي اتاخدت
daysDaysالأيام
creatorsCreatorsصنّاع المحتوى
salesSalesالمبيعات
commissionCommissionالعمولة
action.liveRequest a changeاطلب تعديل
action.waitingEdit requestعدّل الطلب
action.rejectedEdit 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

  1. Card: article.kit-blk-ccard, lifts on hover.
  2. Hit button: named by the title, opens ChallengeDetail.
  3. Head: .kit-blk-ccard-h.kit-blk-tone--<tone>: h3 title + StatusPill; "1 Nov → 30 Nov 2026 · 15% of sale".
  4. 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: ProgressRow Gifts taken, ProgressRow Days (ink), KeyValue columns={3} Creators / Sales / Commission.
  5. Note (optional): e.g. "Your change request is with TRNDR".
  6. Action (with onAction): small button.

Variants

statusPillBodyAction
'live'Liveprogress + figures"Request a change"
'waiting'Waitingsent note"Edit request"
'rejected'Rejectedreason banner"Edit and resend"
'ended'Endedprogress + figuresnone
'closed'Endedprogress + figuresnone
'scheduled'Scheduledprogress + figuresonly with labels.action.scheduled
'paused'Pausedprogress + figuresonly 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 closed and scheduled only for the console's states.
  • Show TRNDR's reason verbatim on rejected cards.

Don't

  • Don't add your own buttons; use onAction and labels.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 carry role="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.

See also: Banner · KeyValue · Button · Money · StatusPill · ProgressRow · useLanguage · useMoneyDisplay · BonusCard · BonusDetail

Source

src/blocks/motivation/ChallengeCard.tsx (line 96) on GitHub.

On this page