StealThis .dev

Widget — Add-widget / customize panel

A self-contained Plotline Insights dashboard with an Add-widget flow — a button slides open a focus-trapped customize panel that lists every available widget as a card with an icon, description and an on/off toggle. Search and category chips filter the catalog, toggling a widget drops it straight into the live 12-column grid, and a remove control pulls it back out with a tidy empty state when nothing is left. Widgets carry KPI sparklines, an inline SVG line chart, bars, a donut, a ranked table and a live-ticking activity feed.

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

Code

Add-widget / customize panel

A “Plotline Insights” analytics dashboard built around an add-widget / customize flow. The shell has a sidebar nav, a page header with a date-range control and a live widget counter, and a responsive 12-column grid of widget cards. Each card shows a typed icon, a title, a remove (x) button, and a real data visualization — KPI tiles with up/down deltas and inline SVG sparklines, an area + line revenue chart, a grouped bar chart of signups by channel, a plan-mix donut, a ranked top-pages table, and a live activity feed that ticks new events every few seconds.

Pressing Add widget slides open a focus-trapped side panel listing the full catalog as cards, each with an icon, description and an accessible on/off switch. A search box filters the catalog as you type and category chips (KPIs, Charts, Data) narrow it further, with a friendly “no results” message when nothing matches. Toggling a card on drops the widget straight into the live grid; toggling it off — or hitting the card’s remove button — animates it out and re-syncs the catalog so the two views never disagree.

When every widget is removed the grid swaps to an illustrated empty state inviting you to add your first widget. Everything is vanilla JS with no libraries: the panel traps Tab focus and closes on Escape or scrim click, the sidebar collapses to an off-canvas drawer below 720px, the grid reflows to a single column on small screens, and all motion respects prefers-reduced-motion.