GroupCard
The Groups tab's card (.ccard): a tinted band, the name and member count, up to five faces and "+N", the commission pill and the group's sales with its "?". The whole card opens the group: one stretched button under the content (the Find card's pattern), so the sales "?" can be its own button beside it, not nested inside.
import { GroupCard } from '@ergasti/bricks';Examples
Group cards
A tone, the first members as an avatar stack, the group's sales and where its commission stands: standard, asked (waiting for TRNDR) or approved. The cards sit in an auto-fill grid with a NewCard last.
Code
import { GroupCard, NewCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function Cards() {
return (
<div className="kit-cards" style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(min(100%, 280px), 1fr))', gap: 16 }}>
{blocksData.GROUPS.map((g) => (
<GroupCard key={g.id} name={g.name} tone={g.tone} members={g.members} commission={g.commission} sales={blocksData.groupSales(g.members)} onOpen={() => {}} />
))}
<NewCard title="+ New group" sub="Pick the creators by hand" onClick={() => {}} />
</div>
);
}Commission pill
The pill on its own, for your own group rows. It needs the group words (copy, with mixed for the "Mixed" state), since the pill is drawn outside a component that reads the provider. A set rate is said in the long words ("20% of sale"); language picks their language (default: the provider's).
Code
import { GroupCommissionPill } from '@ergasti/bricks';
function Pill() {
const copy = { creators: (n: number) => `${n} creators`, standard: (rate: string) => `Standard ${rate}`, asked: (label: string) => `Asked: ${label}`, mixed: 'Mixed' };
return (
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
<GroupCommissionPill commission={{ state: 'standard' }} standardRate="15%" copy={copy} />
<GroupCommissionPill commission={{ state: 'asked', label: 'EGP 30 per item' }} standardRate="15%" copy={copy} />
<GroupCommissionPill commission={{ state: 'approved', label: '20% of sale' }} standardRate="15%" copy={copy} />
<GroupCommissionPill commission={{ state: 'set', kind: 'per_item', value: '30' }} standardRate="15%" copy={copy} language="en" />
<GroupCommissionPill commission={{ state: 'mixed' }} standardRate="15%" copy={copy} />
</div>
);
}Another standard rate
standardRate is the program's standard rate in words, shown while the group has no special commission (default "15%").
Code
import { GroupCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function StandardRate() {
const g = blocksData.GROUPS[0];
return <div style={{ maxWidth: 320 }}><GroupCard name={g.name} tone={g.tone} members={g.members} commission={{ state: 'standard' }} sales={blocksData.groupSales(g.members)} standardRate="10% of sale" onOpen={() => {}} /></div>;
}Rates the brand sets itself
{ state: 'set', kind, value } is an ok pill in the long words, "20% of sale" or "EGP 30 per item" (label replaces them); { state: 'mixed' } says "Mixed". Without sales the card has no figure; memberCount counts beyond the faces sent.
Code
import { GroupCard } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function SetAndMixed() {
const g = blocksData.GROUPS[0];
return (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(min(100%, 280px), 1fr))', gap: 16 }}>
<GroupCard name={g.name} tone="lime" members={g.members} commission={{ state: 'set', kind: 'percent', value: '20' }} sales={blocksData.groupSales(g.members)} onOpen={() => {}} />
<GroupCard name="TikTok first" tone="sky" members={g.members} commission={{ state: 'set', kind: 'per_item', value: '30' }} onOpen={() => {}} />
<GroupCard name="New this month" tone="butter" members={g.members.slice(0, 3)} memberCount={12} commission={{ state: 'mixed' }} 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 groupCard, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
creators | 2 creators | ليس رقمًا صانع محتوى |
standard | Standard {r} | العادية {r} |
asked | Asked: {l} | طلبت: {l} |
mixed | Mixed | مختلفة |
Design guidance
How the BRICKS design system uses GroupCard. Written in docs/content/components/GroupCard.md; the props above are read from the code, which wins where the two disagree.
A creator group card for the Groups tab: a tinted band, the group name and member count, up to five faces and "+N", the commission pill and the group's sales; the whole card opens the group drawer.
It is the mock's .ccard on Brand › Creators › Groups, laid out in a grid ending with the dashed "+ New group" card (NewCard). The card is one stretched button under the content (named "Top sellers, 12 creators"), so the sales "?" can be its own button beside it. Sales is the server's 2-dp string shown compact; leave it out until the API sends it.
Anatomy
- Card:
article.kit-blk-gcard, min height 190, 1px line,--r-lg, lifts on hover; focus ring drawn around the card. - Hit button:
.kit-blk-hitcovering the card. - Band: 54px strip in the group's tone (
kit-blk-tone--<tone>), decorative. - Body: padding 16 18 18, 12px gaps:
- Row: name (16px bold, ellipsis) + muted "12 creators";
- Faces:
AvatarStack(max 5, "+N" frommemberCount); - Footer:
GroupCommissionPill+ sales (MoneyNote figure="sales"around the compact amount).
Variants
| Prop | Values | When |
|---|---|---|
tone | 'lime' | 'rasp' | 'butter' | 'sky' | 'lilac' | Band colour; one per group. |
commission.state | standard / asked / approved / set / mixed | See GroupCommissionPill. |
money | MoneyDisplay | Sales display (default compact "EGP 184.3K"). |
States
| State | Trigger |
|---|---|
| Default / hover | lift on hover. |
| Focus-visible | 2px --rasp outline around the card. |
| No members | members=[]: empty stack, "0 creators". |
| Before sales | sales undefined: no figure, no "?". |
| More than faces | memberCount > members.length: "+N". |
Types
GroupCopy (labels): creators(n), standard(r), asked(l), mixed.
Usage
// Brand › Creators › Groups
<Banner tone="info" icon="creators">Group creators to ask TRNDR for a special commission for a group. A special commission applies only after the TRNDR team approves it.</Banner>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(260px, 1fr))', gap: 16 }}>
{groups.map((g) => (
<GroupCard key={g.id} name={g.name} tone={g.tone} members={g.members} memberCount={g.count}
commission={g.commission} sales={g.sales} onOpen={() => openGroup(g.id)} />
))}
<NewCard title="+ New group" onClick={openNewGroup} />
</div><GroupCard name="Top sellers" tone="lime" members={people} sales="314610.00"
commission={{ state: 'approved', label: '20% of sale' }} onOpen={open} />Where it appears
- Brand › Creators › Groups › group cards (
.ccard) (BrandCreators).
Guidelines
Do
- Give each group a stable tone so card and drawer match.
- Send
memberCountwhen you send only the first faces.
Don't
- Don't add buttons inside the card besides the sales "?"; actions live in the drawer.
RTL and Arabic
- Mirrors; name
dir="auto". Arabic count: "12 صانع محتوى".
Tokens
--card, --line, --r-lg, --rasp (focus), tone pairs --lime-50/--olive, --rasp-50, --butter/--butter-ink, --sky/--sky-ink, --lilac/--lilac-ink.
Accessibility
- One button named "name, N creators"; the band and faces are decorative; the sales "?" is a separate button.
- Focus outline wraps the whole card.
Found in the source
- ARIA attributes set:
aria-label,aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
GroupPanel: the drawer it opens.GroupForm: create / edit.NewCard: the "+ New group" card (title,sub,onClick).GroupCommissionPill,AvatarStack.
See also: MoneyNote · Money · Pill · CommissionRate · useLanguage · useMoneyDisplay · CommissionInput
Source
src/blocks/groups/GroupCard.tsx (line 80) on GitHub.