StealThis .dev
Pages Hard

Dashboard — Finance (P&L · cashflow)

A finance dashboard for the fictional Northwind Beverage Co. built with plain HTML, CSS and JavaScript. A KPI row tracks revenue, expenses, net profit and cash balance with up or down deltas and tiny inline-SVG sparklines, while a profit-and-loss waterfall and a cashflow area chart are drawn entirely in SVG. A budget-versus-actual progress list flags overspend, a category-badged transactions table colors inflows and outflows, and a month, quarter or year selector recomputes every KPI, redraws both charts and refilters the table with formatted currency.

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

Code

Finance (P&L · cashflow)

A finance overview for the fictional Northwind Beverage Co. The page opens with four KPI cards — Revenue, Expenses, Net profit and Cash balance — each showing a value, an up/down delta versus the prior period colored against --ok/--danger, and a tiny inline-SVG sparkline. Expenses invert the usual semantics, so a decrease reads as good. Below sits a widget grid: a profit-and-loss waterfall (revenue stepping down through COGS, payroll, marketing and other to net), a cashflow area chart with a gradient fill and hover points, a budget-versus-actual progress list that flags overspend in amber and red, and a category-badged recent-transactions table with +/- amounts colored by flow.

Every chart is drawn with inline SVG — bars, connectors, gridlines, area paths and sparklines — with no chart library, no <canvas> and no images. KPI values count up with an eased animation, currency is formatted compactly ($482K, $1.42M) with full figures in tooltips and the table, and the cash balance gently ticks live unless prefers-reduced-motion is set.

The month / quarter / year segmented control is the core interaction: switching periods swaps the entire dataset, recomputes the KPIs and deltas, redraws both charts, re-animates the budget bars and refilters the transactions, with a toast confirming the active period. The transactions table has its own All / Inflow / Outflow chips, an Export action fires a toast, and the layout collapses to a single column with an off-canvas sidebar around 720px while staying usable down to ~360px.