StealThis .dev
Pages Medium

Dashboard — Bento-grid layout

A bento-style analytics dashboard built on a CSS grid of mixed-size tiles — a 2x2 hero area chart, four KPI cards with deltas and inline sparklines, a donut breakdown of traffic sources, a horizontal bar ranking, a live activity feed, and a goal gauge. A sticky topbar carries the brand, search and account. The refresh button re-rolls all fictional metrics with a smooth count-up animation, tiles lift on hover, headers drag to rearrange, and the grid reflows from four columns to one as the viewport narrows.

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

Code

Bento-grid layout

A self-contained product dashboard for the fictional Nimbus Analytics workspace, laid out as a bento grid: one CSS grid of unequal tiles where a hero revenue chart spans 2×2, the donut and activity tiles run two rows tall, and the channel-ranking tile spans two columns. Every widget is a card with its own header, optional ⋯ menu and a drag handle. All charts are hand-built inline SVG — a smoothed area/line for the hero, four KPI sparklines, a stroke-dasharray donut, and a semicircular goal gauge — so there are no chart libraries, <img> tags or canvas anywhere.

Interactions are all vanilla JS. The date-range segmented control (7d / 30d / 90d / 12m) and the Refresh button both re-roll the demo dataset and re-render every tile, with KPI and total values counting up via a cubic ease. The bars tile toggles between Revenue and Orders, the activity feed ticks in a new fictional event every few seconds, and tiles can be dragged by their header to swap positions on the board. A toast() helper confirms each action.

The whole thing is keyboard-usable and AA-contrast: landmark roles on the topbar and main, aria labels on deltas and charts, a skip link, visible focus rings, and ⌘K/Ctrl+K to jump to search. The grid collapses to two columns by ~1080px and a single column by ~720px, stays usable down to ~360px, and respects prefers-reduced-motion.