Passer au contenu principal

WidgetCard

Implemented

Generic 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).

Categorymolecules
Sourcepatterns/molecules/widgetcard.html
AI HintW2 organisms-plan extraction of admin.css .chart-card / .side-card / .accent-card. Use for any dashboard KPI/chart/rail/accent card shell — do NOT hand-roll a div.chart-card or div.side-card wrapper. Pick variant by slot: primary content chart, right-rail side, settlement/dark CTA accent. Site-specific inner lists (bigrevenue-*, accent-split) stay as children with their own classes.

Generic 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

Last 30 days
  • 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

This week
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

Sep 15, 2026
Scheduled

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

Prop
Type
Default
Description
title
React.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).

subtitle
React.ReactNode
—

Secondary line under the title (date ranges, scopes). Muted on chart/side, inverse on accent.

action
React.ReactNode
—

Right-aligned header slot — filters, view-all links, status badges. Never wraps the title.

children*
React.ReactNode
—

Card body.

footer
React.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.

Props

Preview

WidgetCard

Prop
Type
Required
Default
Description
title
React.ReactNode
Optional
—

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).

subtitle
React.ReactNode
Optional
—

Secondary line under the title (date ranges, scopes). Muted on chart/side, inverse on accent.

action
React.ReactNode
Optional
—

Right-aligned header slot — filters, view-all links, status badges. Never wraps the title.

children
React.ReactNode
Required
—

Card body.

footer
React.ReactNode
Optional
—

Slot rendered after the body (footnotes, sample-data disclaimers).

variant
'chart' | 'side' | 'accent'
Optional
'chart'

Surface variant: chart = bg + border (primary content), side = borderless rail card, accent = theme-stable dark card.

as
'section' | 'div' | 'aside'
Optional
'section'

Rendered element.

Quick use:<WidgetCard />

Accessibility

ARIA roleregion

ARIA

1 rule

WCAG 1.3.1

Card is aria-labelledby-wired to its own h3 (auto-generated id) unless the consumer names it via aria-label/aria-labelledby

Type

1 rule

NASA Rule 5

variant must be one of chart | side | accent

a11y

1 rule

WCAG 1.4.3

accent variant is dark in BOTH themes — text-inverse only children, never text-heading utilities inside

target

1 rule

WCAG 2.5.8

Interactive content in the action slot must meet the 44x44px minimum (--ep-tap-min)

Usage

Import

tsxSnippet
import { WidgetCard } from "@epasslive/design-system"

Example 1

tsxSnippet
<WidgetCard variant="chart" title={t("timeseries")} action={<DateFilter …} >{rows}</WidgetCard>

Example 2

tsxSnippet
<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

Design System v4.1.0 | ePassLive