Skip to Content
BBRICKSv0.7.4
BlocksBundles

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.

bundleCard
KeyEnglishArabic
videos2 videosليس رقمًا فيديو
pricePriceالسعر
perVideoper videoللفيديو
bestValueBest valueأحسن قيمة
includesWhat's includedالباقة فيها إيه
buyBuy bundleاشتري الباقة
buyingBuying…بنشتري…
closedNot 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

  1. Card: article.kit-blk-bundle, 1px line, --r-lg, named by its title. best adds a raspberry ring; closed greys the head.
  2. Head: .kit-blk-bundle-h, lilac (lime when best, soft grey when closed), padding 18 20:
    1. Name h3, display 17 / 700;
    2. Best value lime Pill;
    3. Videos display 24 / 800 ("12 videos").
  3. Body: .kit-blk-bundle-b, 14px gaps:
    1. Price line: "Price" label (a MoneyNote when figure is set), price display 22 / 800, "EGP 400.00 per video" muted;
    2. Includes: ul named "What's included", green ✓ per line;
    3. Buy: full-width Button (rasp when best, ink otherwise), pushed to the bottom;
    4. Reason: "🔒 Sold out this month", 12px muted.

Variants

SetupLookWhen to use
PlainLilac head, ink BuyStandard offer.
bundle.bestValueLime head, raspberry ring, rasp Buy, "Best value" pillThe server's recommended bundle.
Closed (closedReason / unavailable)Grey head, disabled Buy, lock reasonSold out; bundles not open yet.
No onBuyNo buttonRead-only listing.

States

StateTrigger
Default—
Buyingbuying: Buy disabled, aria-busy, reads "Buying…".
Closedreason set: Buy disabled and described by the reason.
No includesincludes 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 includes to 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 article named by its h3; includes list named "What's included"; ticks are aria-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.

See also: MoneyNote · Button · Money · Pill · useLanguage · useMoneyDisplay · MoneyNotesProvider

Source

src/blocks/bundles/BundleCard.tsx (line 94) on GitHub.

On this page