BundleCard
A UGC bundle card: a lilac band with the name, the videos included and an optional "Best value" pill; the price and the price per video; what's included (✓ lines); and Buy. A closed bundle (its own reason, or the grid's) keeps its button, disabled, with the reason under it and read with it.
import { BundleCard } from '@ergasti/bricks';Examples
UGC bundles
A bundle's videos, price and price per video, a "Best value" mark, and a Buy button; a closed bundle shows why.
Code
import { BundleCard, type UgcBundle } from '@ergasti/bricks';
const bundles: UgcBundle[] = [
{ id: 1, name: 'Starter', videos: 5, price: '2500.00', perVideo: '500.00', includes: ['5 creator videos', '1 revision each'] },
{ id: 2, name: 'Growth', videos: 15, price: '6000.00', perVideo: '400.00', bestValue: true, includes: ['15 creator videos', '2 revisions each', 'Raw files'] },
{ id: 3, name: 'Scale', videos: 40, price: '14000.00', perVideo: '350.00', closedReason: 'Not available for your plan yet' },
];
function Cards() {
return (
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }}>
{bundles.map((b) => <BundleCard key={b.id} bundle={b} onBuy={() => {}} />)}
</div>
);
}The grid with its states
The grid lays the cards out and draws loading, error and empty; buyingId shows which card is being bought.
Code
import { BundleGrid, type UgcBundle } from '@ergasti/bricks';
const bundles: UgcBundle[] = [
{ id: 1, name: 'Starter', videos: 5, price: '2500.00', perVideo: '500.00', includes: ['5 creator videos', '1 revision each'] },
{ id: 2, name: 'Growth', videos: 15, price: '6000.00', perVideo: '400.00', bestValue: true, includes: ['15 creator videos', '2 revisions each', 'Raw files'] },
{ id: 3, name: 'Scale', videos: 40, price: '14000.00', perVideo: '350.00', closedReason: 'Not available for your plan yet' },
];
function Grid() {
return (
<div style={{ display: 'grid', gap: 16 }}>
<BundleGrid bundles={bundles} onBuy={() => {}} buyingId={2} />
<BundleGrid bundles={[]} status="error" error="We could not load the bundles." onRetry={() => {}} />
</div>
);
}Buying, closed, and the price note
buying marks the card whose purchase is opening; unavailable closes a card with a reason (the grid passes one to all); figure puts a money "?" on the price from your notes dictionary.
Code
import { BundleCard, MoneyNotesProvider, useLanguage, type UgcBundle } from '@ergasti/bricks';
import { moneyNotes } from './sample-data';
const bundles: UgcBundle[] = [
{ id: 1, name: 'Starter', videos: 5, price: '2500.00', perVideo: '500.00', includes: ['5 creator videos', '1 revision each'] },
{ id: 2, name: 'Growth', videos: 15, price: '6000.00', perVideo: '400.00', bestValue: true, includes: ['15 creator videos', '2 revisions each', 'Raw files'] },
{ id: 3, name: 'Scale', videos: 40, price: '14000.00', perVideo: '350.00', closedReason: 'Not available for your plan yet' },
];
function CardStates() {
const language = useLanguage();
return (
<MoneyNotesProvider notes={moneyNotes(language)}>
<div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }}>
<BundleCard bundle={bundles[0]} onBuy={() => {}} buying figure="program_cost" />
<BundleCard bundle={bundles[1]} onBuy={() => {}} unavailable="UGC bundles open when your wallet goes live" />
</div>
</MoneyNotesProvider>
);
}Grid loading and closed
status="loading" draws placeholder cards; unavailable closes every card with one reason. figure and cardLabels pass through to each card.
Code
import { BundleGrid, MoneyNotesProvider, useLanguage, type UgcBundle } from '@ergasti/bricks';
import { moneyNotes } from './sample-data';
const bundles: UgcBundle[] = [
{ id: 1, name: 'Starter', videos: 5, price: '2500.00', perVideo: '500.00', includes: ['5 creator videos', '1 revision each'] },
{ id: 2, name: 'Growth', videos: 15, price: '6000.00', perVideo: '400.00', bestValue: true, includes: ['15 creator videos', '2 revisions each', 'Raw files'] },
{ id: 3, name: 'Scale', videos: 40, price: '14000.00', perVideo: '350.00', closedReason: 'Not available for your plan yet' },
];
function GridStates() {
const language = useLanguage();
return (
<MoneyNotesProvider notes={moneyNotes(language)}>
<div style={{ display: 'grid', gap: 16 }}>
<BundleGrid bundles={[]} status="loading" />
<BundleGrid bundles={bundles.slice(0, 2)} onBuy={() => {}} unavailable="UGC bundles open when your wallet goes live" figure="program_cost" cardLabels={{ buy: 'Get bundle' }} />
<BundleGrid bundles={[]} />
</div>
</MoneyNotesProvider>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key bundleCard, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
videos | 2 videos | ليس رقمًا فيديو |
price | Price | السعر |
perVideo | per video | للفيديو |
bestValue | Best value | أحسن قيمة |
includes | What's included | الباقة فيها إيه |
buy | Buy bundle | اشتري الباقة |
buying | Buying… | بنشتري… |
closed | Not available | مش متاحة |
Design guidance
How the BRICKS design system uses BundleCard. Written in docs/content/components/BundleCard.md; the props above are read from the code, which wins where the two disagree.
A UGC bundle offer card: a tinted head with the bundle name, the number of videos and an optional "Best value" pill, then the price and price per video, what's included and Buy; use it inside BundleGrid.
A bundle is a number of creator videos for one price. The card shows the server's figures (2-dp strings) and never guesses: "Best value" is the server's flag, and the per-video price is the server's value, or the price divided by the videos (half up, to the cent) when it is left out. A closed bundle (its own closedReason or the grid's unavailable) keeps its button, disabled, with the reason under it and read with it. Bundles are not in the v3 mock; this block follows the kit's card look.
Anatomy
- Card:
article.kit-blk-bundle, 1px line,--r-lg, named by its title.bestadds a raspberry ring;closedgreys the head. - Head:
.kit-blk-bundle-h, lilac (lime when best, soft grey when closed), padding 18 20:- Name
h3, display 17 / 700; - Best value lime
Pill; - Videos display 24 / 800 ("12 videos").
- Name
- Body:
.kit-blk-bundle-b, 14px gaps:
Variants
| Setup | Look | When to use |
|---|---|---|
| Plain | Lilac head, ink Buy | Standard offer. |
bundle.bestValue | Lime head, raspberry ring, rasp Buy, "Best value" pill | The server's recommended bundle. |
Closed (closedReason / unavailable) | Grey head, disabled Buy, lock reason | Sold out; bundles not open yet. |
No onBuy | No button | Read-only listing. |
States
| State | Trigger |
|---|---|
| Default | — |
| Buying | buying: Buy disabled, aria-busy, reads "Buying…". |
| Closed | reason set: Buy disabled and described by the reason. |
| No includes | includes empty or missing: list omitted. |
Types
UgcBundle: id: number | string, name: string, videos: number, price: string (2-dp), perVideo?: string | null, bestValue?: boolean, includes?: ReadonlyArray<string>, closedReason?: string | null.
BundleCopy (labels): videos(n), price, perVideo, bestValue, includes, buy, buying, closed.
Usage
<BundleCard
bundle={{ id: 2, name: 'Growth', videos: 12, price: '4800.00', perVideo: '400.00', bestValue: true,
includes: ['12 creator videos, 15–60 s', 'Usage rights for 12 months', 'Two rounds of edits', 'Raw files'] }}
onBuy={(id) => openCheckout(id)}
buying={checkoutId === 2}
/>// Normally rendered by the grid
<BundleGrid bundles={bundles} onBuy={openCheckout} buyingId={checkoutId} />Where it appears
- Library only: not in the v3 mocks (built for the live console). Rendered by
BundleGrid; shown in the missing-brand gallery.
Guidelines
Do
- Mark at most one bundle
bestValue. - Keep
includesto 2–5 short lines. - Give a closed bundle a reason the brand can act on.
Don't
- Don't compute discounts or "save X%" in the UI.
- Don't hide a closed bundle's button; it shows what would be possible.
RTL and Arabic
- Mirrors; prices stay LTR via
Money. Arabic plural rules for videos: "فيديو واحد", "فيديوهين", "5 فيديوهات", "12 فيديو". Buy: "اشتري الباقة".
Tokens
--card, --line, --r-lg, --lilac, --lilac-ink, --lime-50, --olive, --soft, --ink-3, --rasp-50, --rasp-100, --ok, --font-family-display, --lh-ar.
Accessibility
- An
articlenamed by itsh3; includes list named "What's included"; ticks arearia-hidden. - A disabled Buy is described by the reason (
aria-describedby), so the why is read with it.
Found in the source
- ARIA attributes set:
aria-labelledby,aria-label,aria-hidden,aria-busy,aria-describedby.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
BundleGrid: the responsive grid with block states.BundlePurchaseSummary: the checkout it opens.BundleResultBanner: the outcome.
See also: MoneyNote · Button · Money · Pill · useLanguage · useMoneyDisplay · MoneyNotesProvider
Source
src/blocks/bundles/BundleCard.tsx (line 94) on GitHub.