Dashboard Snippets — Free HTML CSS JS Dashboard Components
37 dashboard components · Stats Cards, Kanban Board, Full Layout, Activity Feed, Metric Grid, Status Page, Calendar, Notification Bell · Exports to React, Vue, Angular & Tailwind
What's included
Features
About this tool
Dashboard Snippets — Free Stats Cards, Kanban Board, Full App Layout, Activity Feed & Notification Bell
Dashboard components display operational data, track progress, and enable workflow management. Building a dashboard from scratch requires solving several specific technical challenges: animated metric reveals, drag-and-drop task management, a persistent app shell layout, activity visualisation, and real-time notification state. This collection covers five essential dashboard building blocks — from animated KPI cards to a complete app layout shell.
Every snippet is plain HTML, CSS, and minimal vanilla JavaScript. No charting library, no grid framework, no component library required.
Stats Card with activity heatmap and SVG progress ring. The count-up animation uses IntersectionObserver with threshold: 0.5 — the animation fires exactly once when 50% of the element enters the viewport. obs.disconnect() prevents it from re-firing on scroll back. The animation itself uses requestAnimationFrame with a quartic ease-out curve: progress = 1 - Math.pow(1 - t, 4), where t is elapsed time divided by duration. This creates a fast-start, slow-decelerate reveal that feels dramatic. Numbers over 1000 auto-format to K; over 1000000 to M.
The activity heatmap generates a 52 × 7 grid of day cells with 6 colour intensity levels — using JavaScript to fill random (or real API) activity data into a GitHub-style contribution graph. Each cell is a small div with background colour determined by its activity count.
Dashboard Layout is a complete flex app shell: a 180px fixed dark sidebar with nav links, a top header bar, and a main content area with overflow-y: auto. The sidebar and header are fixed; the main content scrolls independently. This is the foundational structure of any admin panel or SaaS dashboard.
Kanban Board uses the HTML5 Drag and Drop API — no library. draggable="true" on each card. dragstart stores the dragged card in a variable. dragover calls e.preventDefault() to allow the drop. drop appends the stored card to the target column and updates the live card count. A setTimeout(0) delay before adding the .dragging class prevents the ghost image from showing the dimmed card state during drag.
User Stats Card features a GitHub-style 12-week activity heatmap, a circular SVG progress ring, a gradient avatar, follower/following stats, and a follow button toggle. All built with DOM manipulation and SVG — no charting library.
Notification Bell shows an unread badge count, a dropdown panel with notification items, mark-as-read per item and mark-all-read batch action, and click-outside close. The bell icon animates with a CSS ring-swing keyframe when the badge count is non-zero.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
An IntersectionObserver is created with threshold: 0.5, watching each .number element. When 50% of the element is visible in the viewport, the observer callback fires and calls animateValue(). The critical line is obs.disconnect() inside the callback — this removes the observer immediately after the first trigger, so the animation never re-fires if the user scrolls back past the element. Without disconnect(), the count-up would restart every time the element enters the viewport.
Each card has draggable="true". dragstart sets a draggedCard variable to e.currentTarget. Each column has a dragover listener that calls e.preventDefault() — without this, the drop event does not fire. drop appends draggedCard to the column's card list container and calls updateCounts() to refresh all column totals. The setTimeout(0) delay before adding .dragging to the card prevents the browser's drag ghost image from capturing the card in its dimmed state.
The sidebar is currently a fixed 180px left panel. For mobile: @media (max-width: 768px) { .sidebar { position: fixed; left: -180px; transition: left 0.25s ease; z-index: 100; } .sidebar.open { left: 0; } .main { margin-left: 0; } }. Add a hamburger button to the header that calls sidebar.classList.toggle("open"). Add an overlay backdrop that closes the sidebar on click. The main content area automatically fills 100% width when margin-left: 0 is applied.
Yes. Dashboard Layout becomes a root Layout component that wraps all pages. Stats Cards become a StatsCard component with target, label, colour, and pct props — manage the count-up with useEffect and requestAnimationFrame. Kanban Board manages columns and cards with useState, using onDragStart, onDragOver, and onDrop React event handlers. In Next.js App Router, put the Dashboard Layout in app/dashboard/layout.tsx — it wraps all dashboard routes automatically.