Skip to Content
BBRICKSv0.7.4
PR PortalCampaigns

AffiliateProgramCard

A brand page's "Affiliate program" card (the v3 mock's P.brand program card): since when, the Active / Paused pill, three figures (commission, creators, waiting to join), then a ruled row with "Edit program", Pause (asking for the reason first) or Resume, and "Review N join requests →" at the end.

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

Examples

A brand's affiliate program

Three figures, then Edit program, Pause (which asks for the reason the brand sees) and "Review N join requests →". Pause it, then resume.

Code
import { useState } from 'react';
import { AffiliateProgramCard, commissionText } from '@ergasti/bricks';

function AffiliateProgram() {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  return (
    <div style={{ maxWidth: 720 }}>
      <AffiliateProgramCard brandName="Glow Lab" since="Since 1 Oct 2026" status={status} commission={commissionText('percent', '10', 'en')} creatorsCount={86} waiting={1}
        onEdit={() => {}} onPause={() => setStatus('paused')} onResume={() => setStatus('active')} onReviewJoins={() => {}} />
    </div>
  );
}

A campaign's status

ProgramStatusCard: the Active pill, what pausing does, and Pause program behind a required reason.

Code
import { useState } from 'react';
import { ProgramStatusCard } from '@ergasti/bricks';

function Status() {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  return <div style={{ maxWidth: 420 }}><ProgramStatusCard brandName="Glow Lab" creators={86} status={status} onPause={() => setStatus('paused')} onResume={() => setStatus('active')} /></div>;
}

In Arabic

Pinned to Arabic
Code (not run)
import { AffiliateProgramCard, commissionText } from '@ergasti/bricks';

function Arabic() {
  return <div style={{ maxWidth: 720 }}><AffiliateProgramCard brandName="Glow Lab" since="من 1 أكتوبر 2026" commission={commissionText('percent', '10', 'ar')} creatorsCount={86} waiting={2} onEdit={() => {}} onPause={() => {}} onReviewJoins={() => {}} /></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 prProgramCards, or with the component's own prop where it has one. A {name} is a value the component fills in.

prProgramCards
KeyEnglishArabic
statusStatusالحالة
pauseNotePausing stops every creator code from earning straight away. Orders already placed still settle.الإيقاف بيوقّف كل أكواد صنّاع المحتوى عن الكسب فورًا. الطلبات اللي اتعملت قبل كده بتتسوّى عادي.
pausedNoteThe program is paused: creator codes earn nothing until you resume it.البرنامج متوقف: أكواد صنّاع المحتوى مش بتكسب لحد ما تشغّله تاني.
pauseProgramPause programوقّف البرنامج
resumeProgramResume programشغّل البرنامج تاني
programAffiliate programبرنامج الأفلييت
commissionCommissionالعمولة
creatorsCreatorsصنّاع المحتوى
waitingWaiting to joinمستنيين يشتركوا
editEdit programعدّل البرنامج
pausePauseوقّف
resumeResumeشغّله تاني
reviewReview {shown2} join requests →راجع {shown2} طلبات انضمام ←
pauseTitlePause {brand}’s program?توقّف برنامج {brand}؟
pauseSub[object Object][object Object]

Design guidance

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

A brand page's "Affiliate program" card: since when, Active / Paused, the commission, creators and waiting joins, then Edit program, Pause (behind a reason) or Resume, and "Review N join requests →"; use it as the program block of Brand detail.

AffiliateProgramCard is the PR v3 mock's P.brand program card. Three figures sit in a FigureRow (Commission, Creators, Waiting to join), and a ruled footer holds the actions. Pause never fires straight away: the card opens a ReasonDialog in text mode with a raspberry "Pause program" ("Every creator code stops earning straight away. Orders already placed still settle. Glow Lab and its 86 creators are notified."), then calls onPause with the reason; it closes that dialog itself once status turns paused. Its sibling ProgramStatusCard (same file) is the campaign page's "Status" card.

Anatomy

  1. Card with title "Affiliate program" (+ titleAdornment, e.g. the P6 decision tag), since as the muted sub ("Since 1 Oct 2026"), and a PrStatusPill badge (active / paused).
  2. Figures: FigureRow of three: Commission (commission, e.g. commissionText('percent', '10', 'en') → "10% of sale"), Creators (creatorsCount), Waiting to join (waiting); 20px display 800 values.
  3. Footer (only when an action is set): Edit program (sm, ink, pencil icon) · Pause (sm, default, pause icon) or Resume · Review N join requests → (sm, ghost, pushed to the end, only while waiting > 0).
  4. Pause dialog: ReasonDialog mode="text" tone="rasp", title "Pause Glow Lab’s program?".

Variants

PropValueLookWhen to use
statusactive (default)Active pill, Pause buttonA running program
pausedPaused pill, Resume button (no confirmation)A paused program
waiting> 0 with onReviewJoins"Review 1 join request →" / "Review 3 join requests →" at the footer endJoin requests are waiting
0No review linkNothing waiting
titleAdornmenta DecisionTagTag after the titleThe mock's dt('P6')

States

StateTrigger
AskingPause pressed: the reason dialog opens; Confirm with a blank reason says "Write a reason."
Pausingbusy: Pause / Resume and the dialog's confirm are disabled
Pause failedpauseError: shown in the dialog above its buttons; the dialog stays open
Pausedstatus="paused": the dialog closes, Resume shows
No actionsnone of onEdit, onPause, onResume, onReviewJoins (with waiting): no footer

Usage

import { useState } from 'react';
import { AffiliateProgramCard, commissionText, type ReasonResult } from '@ergasti/bricks';

export function GlowProgram() {
  const [status, setStatus] = useState<'active' | 'paused'>('active');
  const [busy, setBusy] = useState(false);
  const pause = ({ reason }: ReasonResult) => {
    setBusy(true);
    window.setTimeout(() => { setBusy(false); setStatus('paused'); console.log('Paused:', reason); }, 600);
  };
  return (
    <AffiliateProgramCard
      brandName="Glow Lab"
      since="Since 1 Oct 2026"
      status={status}
      commission={commissionText('percent', '10', 'en')}
      creatorsCount={86}
      waiting={1}
      busy={busy}
      onEdit={() => {}}
      onPause={pause}
      onResume={() => setStatus('active')}
      onReviewJoins={() => {}}
    />
  );
}
// Brand detail: the program card heads the left column, gift rules under it
import { AffiliateProgramCard, Card, PageGrid, commissionText } from '@ergasti/bricks';

export function BrandLeftColumn() {
  return (
    <PageGrid split="8-4" align="start">
      <PageGrid align="start">
        <AffiliateProgramCard brandName="Glow Lab" since="Since 1 Oct 2026" commission={commissionText('percent', '10', 'en')} creatorsCount={86} waiting={1}
          onEdit={() => {}} onPause={() => {}} onReviewJoins={() => {}} />
        <Card title="Gift rules">Pick, one per challenge, cooldown</Card>
      </PageGrid>
      <Card title="PR owner">Mona Adel (you)</Card>
    </PageGrid>
  );
}

Where it appears

  • PR Portal › Brand detail › Affiliate program card (the mock's P.brand; Edit program → the campaign page, Review → Approvals › Join requests). Screen: PR · Brand.
  • Its sibling ProgramStatusCard: PR Portal › Affiliate programs › a brand's campaign › Status. Screen: PR · A brand's campaign.
  • Dashboard screen: PrBrand.

Guidelines

Do

  • Write the commission in words with commissionText (or a CommissionRate).
  • Settle a pause by turning status to paused; pass pauseError and keep the dialog open on failure.
  • Pass creatorsCount so the pause dialog says how many creators are notified.

Don't

  • Don't call your own pause API from the Pause button: the card asks for the reason first.
  • Don't show "Review join requests" when nothing waits; the card already hides it at 0.
  • Don't add more figures: three is the mock's row.

RTL and Arabic

The footer mirrors: Edit and Pause on the right, the review link at the left end. Arabic: "برنامج الأفلييت", "العمولة", "صنّاع المحتوى", "مستنيين يشتركوا", "عدّل البرنامج", "وقّف", "راجع طلب انضمام واحد ←". Counts go through count() in the page language. Override with labels or labels.prProgramCards.

Tokens

--ink-3, --font-family-display (figures), Card tokens, --rasp (the dialog's confirm).

Accessibility

  • A Card with a real heading; the status pill is text.
  • Buttons are real <button>s; icons are decorative.
  • The pause dialog is a kit Modal (role="dialog", focus trap, Escape, focus return); inertRef names the app root to make inert.

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

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

See also: Button · Card · Icon · useLanguage · PrIcon · PrStatusPill · CampaignChallenges · CampaignChangeRequests · CustomerAffiliatesCard

Source

src/pr/programs/ProgramCards.tsx (line 133) on GitHub.

On this page