Skip to content
Thrum

SaaS metrics dashboard

Recurring revenue, churn and retention on one screen: MRR, ARR, net revenue retention, churn rate and active customers as headline numbers, MRR over time, the period's MRR movement as a waterfall, the plan mix, trial to paid and retention by signup cohort. Every section is optional and the layout closes up around a missing one. For deals and quota pick the sales dashboard.

Install

npx shadcn@latest add @thrum-pro/saas-metrics-dashboard

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Data shape

Type
type SaasMetricsDashboardData = {
  kpis?: readonly {
    label: string;
    value: number | null;
    format?: Intl.NumberFormatOptions;
    delta?: number | null;                     // 0.124 is +12.4%
    deltaLabel?: string;                       // "vs last month"
    invert?: boolean;                          // a fall is good news, as for churn
    trend?: readonly (number | null)[];
  }[];
  mrr?: readonly { label: string; value: number | null }[];
  movement?: {
    start: number;                             // MRR at the start of the period
    new: number | null;
    expansion: number | null;
    contraction: number | null;                // a positive amount, subtracted
    churn: number | null;                      // a positive amount, subtracted
  };
  plans?: readonly { name: string; value: number }[];
  trial?: readonly { name: string; value: number | null }[];        // first step to last
  cohorts?: {
    periods: readonly string[];                // ["Month 0", "Month 1"]
    cohorts: readonly { name: string; size: number; retained: readonly (number | null)[] }[];
  };
};
Sample
{
  kpis: [{ label: "MRR", value: 196000, format: { style: "currency", currency: "USD", maximumFractionDigits: 0 }, delta: 0.071 }],
  mrr: [{ label: "1 Nov", value: 182400 }, { label: "2 Nov", value: 183100 }],
  movement: { start: 182400, new: 14200, expansion: 6100, contraction: 2300, churn: 4800 },
  cohorts: { periods: ["Month 0", "Month 1"], cohorts: [{ name: "Jul", size: 240, retained: [240, 198] }] },
}

Props

PropTypeDefaultDescription
titlestringRequiredThe heading of the dashboard. It also names the dashboard's region.
dataSaasMetricsDashboardDataRequiredThe figures to draw, one key per section. A key left out is a section not drawn. See the type above.
headingLevel1 | 2 | 3 | 4 | 5Default 2Level of the dashboard's heading. Each section's heading is one level below it.
periodsreadonly { value: string; label: string }[]–Time ranges offered in the header. Leave it out, or pass fewer than two, to hide the control.
periodstring–The selected range, when the parent holds it. Use it with onPeriodChange.
defaultPeriodstring–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.
actionsReactNode–Buttons at the end of the header row, such as Export or Share.
loadingbooleanDefault falseDraw every section, with or without data, as a skeleton of its size, and mark the dashboard busy.
currencystringDefault "USD"ISO 4217 code for every amount: compact amounts on the axes, in the waterfall and in the plan mix.
localestringDefault "en-US"Locale for every number on the dashboard.
soundbooleanDefault trueLet the parts make their sounds, if the visitor has sound on. Set it to false to silence the whole dashboard.
classNamestring–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 view: the cards fade in and rise 8 px one after another, 40 ms apart. Headline numbers appear at once, the MRR area is drawn left to right, the waterfall bars grow, the plan ring sweeps round and the funnel bars grow. All of it ends within about 1.5 s.
  • New data or a new time range: every number rolls and every chart moves to its new values together, in about 400 ms with no overshoot.
  • The layout never animates. Cards keep their size while their contents change.
  • Reduced motion: everything appears complete and changes instantly.

Sound

  • The dashboard has no sounds of its own. Its parts play theirs, if the visitor has sound on.
  • A soft click when the time range changes, one short tone when the headline numbers land on new values, and a tick as a chart cursor moves from point to point.
  • 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 card is a section with a heading one level below the title; the headline numbers have a heading for screen readers only.
  • Every chart keeps its own spoken cursor and hidden data table. The cohort grid is a real table with its caption. Each headline number is a group named by its label, and the change chip says up or down in words; pass invert for churn so a fall shows as good news.
  • The waterfall's steps are named Start, New, Expansion, Contraction, Churn and End; contraction and churn are passed as positive amounts and drawn as losses.
  • The layout is one column when the dashboard is narrow, two from 42rem and a wide card beside a narrow one from 64rem, measured on the dashboard itself. The reading order is the same in all three.
  • Under frosted glass each card turns translucent; nothing inside paints a solid block over it.
  • The words “Time range” and the step and section names are English and fixed in this version; change them in the file.
KeysAction
TabMove through the time range, the actions, each chart and the cohort table, in reading order.
← →On the time range: pick the next range. On a chart: move the cursor one point.
Home / EndOn the time range or a chart: jump to the first or last.
EscOn a chart: hide the cursor.

Source

SourcePro

The source comes with Pro

TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies

Files and dependencies

Adds
components/saas-metrics-dashboard.tsx
Packages
None
Brings along
Dashboard foundationsArea chartCohort gridDonut chartFunnel chartWaterfall chart

Changelog

  1. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor