WidgetCard
ImplementedGeneric dashboard card surface — header (title + subtitle + right-aligned action slot) over a body slot, optional footer after. Variants: chart (bordered, 16px rhythm), side (borderless rail, 14px rhythm), accent (theme-stable dark surface + inverse text).
patterns/molecules/widgetcard.htmlGeneric dashboard card surface — header (title + subtitle + right-aligned action slot) over a body slot, optional footer after. Variants: chart (bordered, 16px rhythm), side (borderless rail, 14px rhythm), accent (theme-stable dark surface + inverse text). W2 extraction of the admin.css .chart-card / .side-card / .accent-card families.
WidgetCard
Molecule — Stats & Dashboard family
Default variant="chart": bordered card for primary content — tables, charts, KPI lists. The title renders as a real <h3> whose id auto-wires the card’s aria-labelledby; the action slot is right-aligned and never wraps the title.
Revenue by event
- Festival Jazz MTL12 480,00 $
- OSM Symphonie n° 58 215,00 $
- Lion d'Or Gala3 940,00 $
Sample data — illustrative only.
This component supports light and dark mode.
SideRail
Molecule — Stats & Dashboard family
variant="side": borderless rail card for secondary columns (right rails, side summaries). 14px rhythm, smaller title treatment.
Quick stats
- Orders
- 148
- Avg. basket
- 64,20 $
- Refunds
- 3
This component supports light and dark mode.
Accent
Molecule — Stats & Dashboard family
variant="accent": theme-stable dark card — dark by design in BOTH themes, inverse text only. Use for settlement boxes, dark CTAs and emphasis surfaces; never put text-heading utilities inside (they stay light-theme-colored).
Next settlement
9 642,75 $
Deposited to •••• 4821 — Nuvei payout.
This component supports light and dark mode.
Usage
WidgetCard is the dashboard card shell — pick the variant by slot: chart for primary content (tables, charts, KPI lists), side for right-rail / secondary columns, and accent for theme-stable dark surfaces (settlement boxes, dark CTAs). The header renders only when at least one of title / subtitle / action is set — omit all three for headless cards (empty-state boxes, error shells). Site-specific inner lists stay as children with their own classes; do not hand-roll a div.chart-card or div.side-card wrapper.
import { WidgetCard, Button } from '@epasslive/design-system'
<WidgetCard
variant="chart"
title={t('timeseries')}
subtitle={t('last30Days')}
action={<DateFilter value={range} onChange={setRange} />}
footer={<SampleDataDisclaimer />}
>
<SalesTable rows={rows} />
</WidgetCard>Accessibility
The card is a landmark-friendly <section> (switch with as) whose accessible name auto-wires to its own <h3> via aria-labelledby, unless you name it explicitly with aria-label / aria-labelledby. The accent variant is dark in both themes — put only inverse-text children inside (WCAG 1.4.3), and keep interactive content in the action slot at or above the 44×44px minimum (--ep-tap-min, WCAG 2.5.8).
Props
titleReact.ReactNodeCard heading, rendered as a real <h3> whose id auto-wires the card’s aria-labelledby. Omit for headless cards (empty-state boxes, error shells).
subtitleReact.ReactNodeSecondary line under the title (date ranges, scopes). Muted on chart/side, inverse on accent.
actionReact.ReactNodeRight-aligned header slot — filters, view-all links, status badges. Never wraps the title.
children*React.ReactNodeCard body.
footerReact.ReactNodeSlot rendered after the body (footnotes, sample-data disclaimers).
variant'chart' | 'side' | 'accent''chart'Surface variant: chart = bg + border (primary content), side = borderless rail card, accent = theme-stable dark card.
as'section' | 'div' | 'aside''section'Rendered element.
Props
WidgetCard
titleReact.ReactNode—Card heading, rendered as a real <h3> whose id auto-wires the card's aria-labelledby. Omit for headless cards (empty-state boxes, error shells).
subtitleReact.ReactNode—Secondary line under the title (date ranges, scopes). Muted on chart/side, inverse on accent.
actionReact.ReactNode—Right-aligned header slot — filters, view-all links, status badges. Never wraps the title.
childrenReact.ReactNode—Card body.
footerReact.ReactNode—Slot rendered after the body (footnotes, sample-data disclaimers).
variant'chart' | 'side' | 'accent''chart'Surface variant: chart = bg + border (primary content), side = borderless rail card, accent = theme-stable dark card.
as'section' | 'div' | 'aside''section'Rendered element.
<WidgetCard />Accessibility
ARIA
1 ruleType
1 rulea11y
1 ruletarget
1 ruleUsage
Import
import { WidgetCard } from "@epasslive/design-system"Example 1
<WidgetCard variant="chart" title={t("timeseries")} action={<DateFilter …} >{rows}</WidgetCard>Example 2
<WidgetCard variant="accent" className="accent-card" role="region" aria-label={t("title")} title={t("title")}>…</WidgetCard>Anti-patterns
— Do not hardcode data in molecules
— Avoid complex business logic in molecules