Overview dashboard
A whole overview page from plain data: headline numbers, a multi-series chart beside a breakdown, a bar chart beside a live feed, and a time-range control in the header. Use it as the first screen of an admin area and swap parts out as the product grows; the file is a short composition of other components, written to be edited.
Install
npx shadcn@latest add @thrum-pro/overview-dashboardThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Data shape
type OverviewDashboardProps = {
title: string;
kpis: readonly KpiGridItem[]; // what a stat card takes
trend: { title: string; labels: readonly string[]; series: readonly LineChartSeries[]; format?: Intl.NumberFormatOptions };
breakdown: { title: string; data: readonly { name: string; value: number }[]; format?: Intl.NumberFormatOptions };
volume: { title: string; data: readonly { label: string; value: number | null }[]; format?: Intl.NumberFormatOptions };
activity: { title: string; items: readonly ActivityFeedItem[] };
};{
kpis: [{ label: "Revenue", value: 48210, delta: 0.124 }],
trend: { title: "Revenue by plan", labels: ["Mon", "Tue"], series: [{ key: "pro", name: "Pro", values: [410, 436] }] },
breakdown: { title: "Traffic sources", data: [{ name: "Direct", value: 4200 }] },
volume: { title: "Orders by weekday", data: [{ label: "Mon", value: 182 }] },
activity: { title: "Recent activity", items: [{ id: "evt_1", title: "Invoice paid", time: "Just now" }] },
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | Required | The heading of the dashboard. It also names the group of headline numbers for screen readers. |
headingLevel | 1 | 2 | 3 | 4 | 5 | Default 2 | The level of the dashboard's heading. Section headings are one level below it. |
kpis | readonly KpiGridItem[] | – | The headline numbers. Each takes what a stat card takes: label, value, format, delta, deltaLabel, goodDirection, trend. Leave out to omit the section. |
trend | { title, labels, series, format? } | – | The main chart: one to five series over time, drawn by the line chart. Leave out to omit the section. |
breakdown | { title, data, format? } | – | Parts of a whole, drawn by the donut chart. Leave out to omit the section. |
volume | { title, data, format? } | – | One value per category or per day, drawn by the bar chart. Leave out to omit the section. |
activity | { title, items } | – | Recent events, newest first, shown by the activity feed. The first five are shown. Leave out to omit the section. |
periods | readonly { value: string; label: string }[] | – | Time ranges offered in the header. Leave it out, or pass fewer than two, to hide the control. |
period | string | – | The selected range, when the parent holds it. Use it with onPeriodChange. |
defaultPeriod | string | – | The range selected at first, when the control holds it itself. |
onPeriodChange | (period: string) => void | – | Called with the new range. Answer it by passing the data for that range; the dashboard does not fetch or filter anything itself. |
actions | ReactNode | – | Buttons at the end of the header row, after the time range control. |
loading | boolean | Default false | Draw every section as a skeleton and mark the dashboard busy while the data loads. |
paused | boolean | Default false | Freeze the loading shimmer where it is. |
locale | string | Default "en-US" | Locale for every number on the dashboard. |
sound | boolean | Default true | Let the parts make their sounds, if the visitor has sound on. Set it to false to silence the whole dashboard. |
className | string | – | Sets the size. The layout follows the width of the dashboard itself, so it also works in a narrow column. |
Motion and sound
Motion
- First draw: lines are revealed left to right, bars grow from the baseline, the ring sweeps round, and the trend lines in the tiles are drawn. Numbers appear at once.
- A new time range: every number rolls and every chart morphs to its new values together, in about 400 ms with no overshoot. Nothing is redrawn from nothing.
- A new event slides in at the top of the feed and the oldest leaves.
- The layout itself never animates. Panels keep their size while their contents change.
- Reduced motion: everything appears complete and changes instantly.
Sound
- A soft click when the time range changes.
- One short tone when the headline numbers land on their new values.
- A tick as a chart cursor moves from point to point, and a soft click with a high tone when an event arrives in the feed.
- Nothing plays when the dashboard first appears.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- The dashboard is a region named by its title. Each panel is a section with its own heading, so a screen reader can jump from panel to panel.
- Every chart keeps its own hidden data table and its own spoken cursor. The feed announces new events politely.
- The layout is one column when the dashboard is narrow, two from 42rem and three from 64rem, measured on the dashboard itself. The reading order is the same in all three.
- The words “Time range” on the control are English and fixed in this version; change them in the file.
| Keys | Action |
|---|---|
| Tab | Move through the time range, the legend of the main chart, each chart and the feed, in reading order. |
| ← → | On the time range: pick the next range. On a chart: move the cursor one point. |
| Home / End | On the time range or a chart: jump to the first or last. |
| Esc | On a chart: hide the cursor. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/overview-dashboard.tsx- Packages
- None
- Brings along
- Dashboard foundationsKPI gridLine chartDonut chartBar chartActivity feedSegmented controlSkeletonMotion tokens
Changelog
- 1.0.0 · 2026-12-02First release.