Skip to Content
BBRICKSv0.7.4
BlocksHome

LiveChallengeCard

Home's live challenge card: its name, dates and creators, the Live pill, gifts taken (25 pips) and the day of the challenge (30 ink pips), then sales, orders and commission. The whole card opens the challenge.

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

Examples

Live challenge on the home page

Title, dates, creators, gift and day progress as pips, and the sales, orders and commission so far. The whole card opens the challenge. The status word comes from the TRNDR preset.

Pinned to TRNDR preset
Code
import { LiveChallengeCard } from '@ergasti/bricks';

function Live() {
  return (
    <div style={{ maxWidth: 560 }}>
      <LiveChallengeCard title="Winter glow launch" dates="1 Nov → 30 Nov" creators={42} gifts={{ taken: 68, total: 100 }} days={{ current: 13, total: 30 }} sales="184300.00" orders={768} commission="27645.00" onOpen={() => {}} />
    </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 liveChallengeCard, or with the component's own prop where it has one. A {name} is a value the component fills in.

liveChallengeCard
KeyEnglishArabic
headingLive challenge · {t}تحدي شغّال · {t}
sub2 · 2 creators joined{d} · ليس رقمًا صانع محتوى اشتركوا
giftsGifts takenالهدايا اللي اتاخدت
daysDaysالأيام
dayOfDay {d} of {n}اليوم {d} من {n}
salesSalesالمبيعات
ordersOrdersالطلبات
commissionCommissionالعمولة

Design guidance

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

Home's live challenge card: the challenge name, dates and creators joined, a Live pill, gifts taken and days as pip rows, then sales, orders and commission; the whole card opens the challenge.

It is the mock's .card.s7.click on Brand › Home. The card is a kit Card with one stretched button named "Live challenge · Winter glow launch"; the figures' money "?" notes sit above it. Money comes as 2-dp strings and shows compact ("EGP 184.3K").

Anatomy

  1. Card: article.kit-card.kit-blk-live, lifts on hover.
  2. Hit button: covers the card, named by the heading.
  3. Header: h2 "Live challenge · Winter glow launch" (dir="auto"), sub "1 Nov → 30 Nov · 42 creators joined", StatusPill status="live".
  4. Gifts row: ProgressRow "Gifts taken", 25 pips, "68 / 100".
  5. Days row: ProgressRow "Days", one ink pip per day (max 31), "Day 13 of 30".
  6. Figures: KeyValue columns={3}: Sales (challenge_sales), Orders, Commission (challenge_commission).

Variants

PropValuesWhen
moneyMoneyDisplayDefault compact; slot liveChallengeCard.figures.

States

StateTrigger
Default / hoverlift.
Focus-visibleinset ring (--focus-ring-inset) drawn just inside the card edge by its stretched button.
First dayzeros: empty pips, "Day 1 of 30", "EGP 0".
Long titlewraps in the header.

Types

LiveChallengeCopy (labels): heading(t), sub(d, n), gifts, days, dayOf(d, n), sales, orders, commission.

Usage

// Brand › Home, beside Top creators
<LiveChallengeCard title="Winter glow launch" dates="1 Nov → 30 Nov" creators={42}
  gifts={{ taken: 68, total: 100 }} days={{ current: 13, total: 30 }}
  sales="184300.00" orders={768} commission="27645.00"
  onOpen={() => navigate('/motivation?challenge=winter-glow')} />

Where it appears

  • Brand › Home › Live challenge card (BrandHome).

Guidelines

Do

  • Show it only while a challenge is live; hide it otherwise.

Don't

  • Don't add buttons inside; the card opens the challenge.

RTL and Arabic

  • Mirrors; pips fill from the right. Arabic: "تحدي شغّال · …", "اليوم 13 من 30", dates "1 نوفمبر → 30 نوفمبر".

Tokens

--card, --line, --r-lg, --rasp, --ink, --track, --soft, --ink-3.

Accessibility

  • One button named by the heading; pips are decorative with the value in words; money labels keep their "?".

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: Money · useLanguage · useMoneyDisplay

Source

src/blocks/home/LiveChallengeCard.tsx (line 55) on GitHub.

On this page