Genesis
@beta

DashboardPage

DashboardPage — a stat row over a flexible region of charts, tables and sections. ```tsx <DashboardPage title="This quarter" subtitle="1 Apr – 30 Jun" actions={<DatePicker … />} stats={ <> <StatCard label="Active clients" value={42} /> <StatCard label="Sessions" value={318} trend={{ value: 12, label: "vs Q1" }} /> </> } > <Section title="Revenue"><ChartContainer …/></Section> <Section title="At risk"><DataTable …/></Section> </DashboardPage> ``` The two regions are separated on purpose. Stats are a fixed-shape row that must reflow as a unit; everything below is free-form and stacks. Folding both into one `children` is how the stat row ends up hand-gridded per page, with a different breakpoint each time — the exact drift `Grid` exists to stop. Children stack at `gap-8`, wider than the page's own `gap-6`, so a chart and the table under it don't read as one block. The header row is markup, not a component, and deliberately not `PageHeader` — see `./detail-page` for the measured reasons composing it was rejected across all four templates. Width is left to `Container` — wrap, don't duplicate. This is a **layout**: it positions tiles and regions and never fetches a metric. A live number is a widget (ADR 0023): pass `<Widget>`s from `@marktiderman/genesis-ui/data` to `stats` as they are, and lay a body of widgets out with `WidgetGrid`. The layout itself stays free of data.

packages/ui/src/components/layout/dashboard-page.tsx

Import
Subpath export: @marktiderman/genesis-ui/layout
import { DashboardPage } from "@marktiderman/genesis-ui/layout";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

DashboardPage

DashboardPage — a stat row over a flexible region of charts, tables and sections. ```tsx <DashboardPage title="This quarter" subtitle="1 Apr – 30 Jun" actions={<DatePicker … />} stats={ <> <StatCard label="Active clients" value={42} /> <StatCard label="Sessions" value={318} trend={{ value: 12, label: "vs Q1" }} /> </> } > <Section title="Revenue"><ChartContainer …/></Section> <Section title="At risk"><DataTable …/></Section> </DashboardPage> ``` The two regions are separated on purpose. Stats are a fixed-shape row that must reflow as a unit; everything below is free-form and stacks. Folding both into one `children` is how the stat row ends up hand-gridded per page, with a different breakpoint each time — the exact drift `Grid` exists to stop. Children stack at `gap-8`, wider than the page's own `gap-6`, so a chart and the table under it don't read as one block. The header row is markup, not a component, and deliberately not `PageHeader` — see `./detail-page` for the measured reasons composing it was rejected across all four templates. Width is left to `Container` — wrap, don't duplicate. This is a **layout**: it positions tiles and regions and never fetches a metric. A live number is a widget (ADR 0023): pass `<Widget>`s from `@marktiderman/genesis-ui/data` to `stats` as they are, and lay a body of widgets out with `WidgetGrid`. The layout itself stays free of data.

PropTypeDefaultDescription
title*ReactNode—Page title. Rendered as the page's single `<h1>`.
actionsReactNode—Trailing controls — a period picker, an export, a refresh.
statColumnsenum4Tiles across the stat row at the widest breakpoint. Default `4`. Reuses `Grid`'s `cols` scale, so the responsive ramp is the same one every other card grid in the app gets.
statsReactNode—The stat row: `<Widget>`s, `StatCard`s, or anything tile-shaped. Laid out in a `Grid` that ramps down to one column on a phone. Omit it and no grid renders.
subtitleReactNode—Supporting line under the title — a date range, a scope, a filter.
testIDstring—Stable test/automation selector (emitted as `data-testid`).