StatTable
ImplementedMulti-section stats table with totals, subtotals per product type. Thuwan-mandated format: Total Available → Ticket Counts → Sales → ePassLive Fees → Transfer to Bank Account. DS-STAT-01 multi-column contract (one <th scope='col'> per declared column) when `columns` is supplied; legacy 2-column (Metric + Amount) when omitted. i18n: `locale` drives Intl.NumberFormat only (en-CA / fr-CA); chrome strings are overridable per prop.
components/organisms/StatTable/StatTable.tsxStatTable component.
StatTable
design-system
StatTable component preview and API reference.
Indicateurs clés
| Metric | Amount |
|---|---|
| Ventes | |
| Revenus nets | 24 850,42 $ |
| Revenus bruts | 27 430,00 $ |
| Frais EP | -962,18 $ |
| Remboursements | -617,40 $ |
| Billets | |
| Vendus | 1 284,00 $ |
| Remboursés | 23,00 $ |
| Compérage | 42,00 $ |
| Total | 26 134,42 $ |
Props
StatTable
sectionsStatSection[]—Grouped rows. Each section renders a header row + its StatRow entries + a column-aligned Total in the tfoot.
columnsStatColumn[]—Optional multi-column header (DS-STAT-01). When omitted the table falls back to the legacy 2-column layout (Metric + Amount, one numeric cell per row).
currencystring'CAD'ISO currency code for Intl.NumberFormat.
locale'en' | 'fr''en'BCP-47 locale for Intl.NumberFormat (en-CA | fr-CA). Does NOT translate chrome strings — pass the *Header / totalLabel / exportLabel / empty-* props for that.
onExport() => void—Optional callback — renders a secondary Export button in the header when provided.
ariaLabelstring'Statistics'Accessible name of the stats region and the sr-only <caption> of the data table. Also rendered as the visible card heading. FR consumers pass e.g. 'Statistiques'.
metricHeaderstring'Metric'Header of the label (first) column. FR consumers pass e.g. 'Métrique'.
amountHeaderstring'Amount'Header of the numeric column in legacy 2-column mode (ignored when `columns` is supplied). FR consumers pass e.g. 'Montant'.
totalLabelstring'Total'Label of the tfoot total row. FR consumers pass 'Total' (same, override kept for completeness).
exportLabelstring'Export'Label of the export button (rendered only when `onExport` is supplied). FR consumers pass e.g. 'Exporter'.
emptyTitlestring'No data available'Title of the empty state. FR consumers pass e.g. 'Aucune donnée disponible'.
emptyMessagestring'Statistics will appear here once sales are recorded.'Body copy of the empty state. FR consumers pass e.g. 'Les statistiques apparaîtront ici dès les premières ventes.'
<StatTable />Accessibility
ARIA
3 rulesvalidation
1 rulecolor
1 ruleresponsive
1 ruleUsage
Import
import { StatTable } from "@epasslive/design-system"Example 1
<StatTable sections={defaultSections} ariaLabel='Sales statistics' onExport={() => {}} />Example 2
<StatTable sections={multiSections} columns={multiColumns} ariaLabel='Sales by product type' />Example 3
<StatTable sections={defaultSections} locale='fr' ariaLabel='Statistiques de ventes' metricHeader='Métrique' amountHeader='Montant' totalLabel='Total' exportLabel='Exporter' />Anti-patterns
— Do not pass both `value` and `values` on the same row — undefined behaviour (single-column and multi-column contracts are mutually exclusive per row).
— Do not hand-roll <table> for stats data — use StatTable for the scope/caption/currency contract (sr-only <caption>, <th scope>, tabular-nums, DM-13 section-header colour).
— Do not localize strings via `locale='fr'` alone — `locale` drives Intl only; pass the `*Header` / `totalLabel` / `exportLabel` / `emptyTitle` / `emptyMessage` props too.
— Do not use the legacy 2-column contract for breakdowns >2 channels — pass `columns[]` + per-row `values[]` instead (DS-STAT-01).