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
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.
| Key | English | Arabic |
|---|---|---|
status | Status | الحالة |
pauseNote | Pausing stops every creator code from earning straight away. Orders already placed still settle. | الإيقاف بيوقّف كل أكواد صنّاع المحتوى عن الكسب فورًا. الطلبات اللي اتعملت قبل كده بتتسوّى عادي. |
pausedNote | The program is paused: creator codes earn nothing until you resume it. | البرنامج متوقف: أكواد صنّاع المحتوى مش بتكسب لحد ما تشغّله تاني. |
pauseProgram | Pause program | وقّف البرنامج |
resumeProgram | Resume program | شغّل البرنامج تاني |
program | Affiliate program | برنامج الأفلييت |
commission | Commission | العمولة |
creators | Creators | صنّاع المحتوى |
waiting | Waiting to join | مستنيين يشتركوا |
edit | Edit program | عدّل البرنامج |
pause | Pause | وقّف |
resume | Resume | شغّله تاني |
review | Review {shown2} join requests → | راجع {shown2} طلبات انضمام ← |
pauseTitle | Pause {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
- Card with title "Affiliate program" (+
titleAdornment, e.g. the P6 decision tag),sinceas the muted sub ("Since 1 Oct 2026"), and aPrStatusPillbadge (active/paused). - Figures:
FigureRowof three: Commission (commission, e.g.commissionText('percent', '10', 'en')→ "10% of sale"), Creators (creatorsCount), Waiting to join (waiting); 20px display 800 values. - 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 whilewaiting > 0). - Pause dialog:
ReasonDialog mode="text" tone="rasp", title "Pause Glow Lab’s program?".
Variants
| Prop | Value | Look | When to use |
|---|---|---|---|
status | active (default) | Active pill, Pause button | A running program |
paused | Paused pill, Resume button (no confirmation) | A paused program | |
waiting | > 0 with onReviewJoins | "Review 1 join request →" / "Review 3 join requests →" at the footer end | Join requests are waiting |
0 | No review link | Nothing waiting | |
titleAdornment | a DecisionTag | Tag after the title | The mock's dt('P6') |
States
| State | Trigger |
|---|---|
| Asking | Pause pressed: the reason dialog opens; Confirm with a blank reason says "Write a reason." |
| Pausing | busy: Pause / Resume and the dialog's confirm are disabled |
| Pause failed | pauseError: shown in the dialog above its buttons; the dialog stays open |
| Paused | status="paused": the dialog closes, Resume shows |
| No actions | none 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 aCommissionRate). - Settle a pause by turning
statustopaused; passpauseErrorand keep the dialog open on failure. - Pass
creatorsCountso 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
Cardwith 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);inertRefnames 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.
Related
ProgramStatusCard: the campaign page's Status card, same pause flow.CommissionChangeForm: where "Edit program" leads.ReasonDialog: the pause confirmation it opens.FigureRow: the three figures.
See also: Button · Card · Icon · useLanguage · PrIcon · PrStatusPill · CampaignChallenges · CampaignChangeRequests · CustomerAffiliatesCard
Source
src/pr/programs/ProgramCards.tsx (line 133) on GitHub.