CardGrid
ImplementedResponsive grid wrapper that renders an array of items as cards via a caller-supplied render function. Supports 1–4 columns and three gap scales, with an empty-state message when the list is empty.
patterns/molecules/cardgrid.htmlResponsive render-prop grid for homogeneous card lists — 1–4 columns, three gap scales, empty-state message.
CardGrid
design-system
Default 3-column grid with medium gap.
Revenue
$12,450
Orders
342
Refunds
$210
AOV
$36.40
Tickets
89
Visitors
1,204
Props
CardGrid
itemsT[]—Data array — generic over the item type T.
renderItem(item: T, index: number) => React.ReactNode—Renders each item — cards are caller-supplied (CardGrid composes no Card atom).
keyExtractor(item: T, index: number) => string—Stable React key per item.
columns1 | 2 | 3 | 43Column count (responsive down-stack handled by the caller's cards).
gap'sm' | 'md' | 'lg''md'Gap scale between cells.
emptyMessagestring—Message rendered when items is empty — omit it and the grid renders nothing (silent empty).
classNamestring—Additional CSS classes on the grid root.
<CardGrid />Accessibility
ARIA
1 ruleType
1 ruleUsage
Import
import { CardGrid } from "@epasslive/design-system"Example 1
<CardGrid items={tickets} renderItem={(t) => <TicketCard ticket={t} />} keyExtractor={(t) => t.id} columns={3} />Example 2
<CardGrid items={[]} columns={2} emptyMessage="No tickets yet." />Anti-patterns
— Do not expect Card surfaces from the grid itself — it wraps caller-supplied cards
— Do not assume an empty-state renders — without emptyMessage an empty list is silent