StealThis .dev
Pages Easy

Dashboard — Single-KPI focus

A focused single-metric dashboard built around one dominant headline number — monthly recurring revenue for a fictional SaaS — with a delta versus the prior period, a large inline-SVG trend chart, and a 7d/30d/90d period selector that swaps the value, recolors the delta, and redraws the line. A row of supporting stats with sparklines, an animated count-up on every change, and a clean whitespace-heavy layout round it out. Pure HTML, CSS, and vanilla JavaScript with no chart libraries.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Single-KPI focus

A deliberately calm dashboard that puts one metric front and centre. The hero panel shows the monthly recurring revenue for Northwind Cloud as a huge headline figure, paired with a delta chip that turns green or red versus the previous period and a one-line plain-language summary. Beneath it sits a large area + line trend chart drawn entirely with inline SVG — gradient fill, smooth path, gridlines, axis labels, and a hover crosshair that reads out the value at any point.

The 7d / 30d / 90d period selector is the primary interaction. Clicking a range swaps the dataset: the headline number animates by counting up or down to its new value, the delta chip recomputes and recolors, the summary copy updates, and the trend line redraws to fit the new window. A small live-toggle nudges the current value every few seconds so the dashboard feels alive, and the supporting stat strip — new customers, churn, ARPU, expansion — each carry their own mini sparkline and up/down delta.

Everything is responsive: the supporting stats reflow from four columns to two to one, the chart scales to its container, and the header filters wrap on narrow screens down to about 360px. Controls are keyboard-operable with visible focus rings, the regions use proper landmark roles, and the whole thing stays within a neutral product-UI palette with generous whitespace so the single metric never has to compete for attention.