Skip to content

Admin Dashboard Layout

Dark Tailwind CSS admin dashboard with off-canvas sidebar, topbar search, KPI cards, SVG revenue chart with date ranges and an orders table.

Also known as: admin dashboard, dashboard layout, admin panel layout, analytics dashboard, dashboard with sidebar

Tailwind CSS Dashboards Responsive Dark #admin #chart #dark #dashboard #sidebar #table

Admin Dashboard Layout live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A dark admin dashboard layout built with Tailwind CSS and vanilla JavaScript. It combines a collapsible sidebar, a sticky topbar with search, four KPI stat cards, an SVG revenue chart with date-range buttons, a top-products list and a recent-orders table.

How it works

The root .tad-app is a flex layout. The aside.tad-sidebar is static from lg up; below that, style.css moves it off screen and hides it with visibility, and the hamburger button marked data-tad-open slides it in by setting a data-open attribute. A blurred [data-tad-overlay] button covers the page while the drawer is open. Clicking the overlay or the data-tad-close button, or pressing Escape, closes it and returns focus to the hamburger.

The range buttons (data-tad-range="7d", "30d", "90d") update everything at once. Each [data-tad-stat] and [data-tad-delta] element stores its value per range in data-7d, data-30d and data-90d; delta lines turn rose when the value starts with a minus sign. The chart is an inline SVG: the script reads the SERIES object, builds the [data-tad-line] and [data-tad-area] paths, prints the axis labels into [data-tad-labels] and writes a text version of the data into the [data-tad-chart-desc] caption. The tad-draw class animates the line on each change. The topbar data-tad-search form filters the rows in [data-tad-rows] as you type and shows [data-tad-empty] when nothing matches.

Customization

  • SERIES at the top of script.js: replace the labels and values arrays with data from your API; the paths rescale automatically.
  • data-7d, data-30d and data-90d on stat elements: set the KPI text for each range.
  • cyan-400 utilities and the #22d3ee stroke and gradient stops in the SVG: change the accent color.
  • w-64 on .tad-sidebar: make the sidebar wider or narrower.
  • max-width: 1023.98px in style.css together with the lg: classes: change the breakpoint where the sidebar becomes a drawer.
  • Status badges such as bg-emerald-400/10 text-emerald-300: add new states by copying a badge and changing the color name.

Use cases

  • SaaS back offices: a collapsible sidebar and sticky topbar with search organize navigation
  • Analytics: four KPI cards and a revenue chart with date-range buttons show performance
  • E-commerce admin: a top-products list and recent-orders table summarize sales
  • Internal tools: the off-canvas sidebar works on small screens

Accessibility

The sidebar is labelled, the current page link carries aria-current="page", and the drawer button exposes aria-expanded. While closed on small screens the drawer uses visibility: hidden, so its links are not reachable with Tab. Range buttons use aria-pressed, the stat list is a polite live region, and the chart has role="img" with a caption that lists every value. The scrollable table wrapper is focusable and labelled, headers use scope="col", and transitions stop under prefers-reduced-motion: reduce.

Usage notes

The chart needs no library. For live data, fetch your numbers, update SERIES and trigger a click() on the active [data-tad-range] button to redraw it.

Admin Dashboard Layout at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS
Layout
Responsive, works on mobile, dark design
Category
Dashboards
License
Free for personal and commercial use

Questions about this template

Can I use the Admin Dashboard Layout code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Admin Dashboard Layout – free Tailwind CSS dashboard template
Admin Dashboard Layout · free Tailwind CSS dashboard template

More Dashboards

Bootstrap Admin Dashboard Layout – free Bootstrap 5 dashboard template

Bootstrap Admin Dashboard Layout

Bootstrap 5 admin dashboard with a responsive offcanvas sidebar, KPI cards, an SVG revenue chart, category meters and a filterable recent orders table.