Free
View template
Pulse — analytics dashboard
A refined analytics workspace with interactive date ranges, a revenue chart, searchable orders and task checklists.
Tools
Company
Blog About us Contact usCreate & learn
PlaygroundAPI TesterTemplatesCreditsGuided projectsChallengesLearnTutorialsAdmin dashboards Free template
A responsive admin layout with a collapsible sidebar, KPI cards, a bar chart drawn on a canvas and a sortable, searchable table.
The preview runs in a sandbox: it cannot reach your account, cookies or the network.
The skeleton of a back-office screen: a sidebar that collapses on small screens, four summary cards, a bar chart drawn with the canvas API (no chart library) and an orders table you can search and sort by clicking the column headings. The sample data lives in one array at the top of app.js, so replacing it with your own data is the first step.
Look under the hood
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dashboard</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="layout" id="layout">
<aside class="side" aria-label="Sidebar">
<div class="logo">Acme Admin</div>
<nav>
<a href="#" class="active">Overview</a>
<a href="#">Orders</a>
<a href="#">Customers</a>
<a href="#">Products</a>
<a href="#">Settings</a>
</nav>
</aside>
<div class="content">
<header class="head">
<button type="button" id="menu" aria-label="Show or hide the menu" aria-expanded="true">Menu</button>
<h1>Overview</h1>
</header>
<main>
<section class="kpis" aria-label="Key numbers">
<article><span>Revenue</span><strong id="k-revenue">0</strong></article>
<article><span>Orders</span><strong id="k-orders">0</strong></article>
<article><span>Average order</span><strong id="k-average">0</strong></article>
<article><span>Shipped</span><strong id="k-shipped">0</strong></article>
</section>
<section class="panel">
<h2>Revenue by month</h2>
<canvas id="chart" width="720" height="240" role="img" aria-label="Bar chart of revenue by month"></canvas>
</section>
<section class="panel">
<div class="row"><h2>Recent orders</h2><label class="search">Search <input id="search" type="search" placeholder="Name or status"></label></div>
<div class="scroll">
<table>
<thead><tr>
<th><button type="button" data-sort="id">Order</button></th>
<th><button type="button" data-sort="customer">Customer</button></th>
<th><button type="button" data-sort="amount">Amount</button></th>
<th><button type="button" data-sort="status">Status</button></th>
</tr></thead>
<tbody id="rows"></tbody>
</table>
</div>
</section>
</main>
</div>
</div>
<script src="app.js"></script>
</body>
</html>
// Replace this sample data with your own (for example loaded from your API).
const orders = [
{ id: 1042, customer: 'Maria Lopez', amount: 129.5, status: 'shipped' },
{ id: 1043, customer: 'Chen Wei', amount: 54.0, status: 'pending' },
{ id: 1044, customer: 'Ahmed Khan', amount: 310.25, status: 'shipped' },
{ id: 1045, customer: 'Sofia Rossi', amount: 89.9, status: 'cancelled' },
{ id: 1046, customer: 'Liam Johnson', amount: 199.0, status: 'shipped' },
{ id: 1047, customer: 'Aiko Tanaka', amount: 75.4, status: 'pending' },
{ id: 1048, customer: 'Noah Smith', amount: 420.0, status: 'shipped' },
];
const monthly = [
['Jan', 4200], ['Feb', 3800], ['Mar', 5100], ['Apr', 4700], ['May', 6200], ['Jun', 5900],
];
const money = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });
// Menu
const layout = document.getElementById('layout');
const menu = document.getElementById('menu');
menu.addEventListener('click', () => {
const collapsed = layout.classList.toggle('collapsed');
menu.setAttribute('aria-expanded', String(!collapsed));
});
// Key numbers
const shipped = orders.filter((o) => o.status === 'shipped');
const revenue = shipped.reduce((sum, o) => sum + o.amount, 0);
document.getElementById('k-revenue').textContent = money.format(revenue);
document.getElementById('k-orders').textContent = orders.length;
document.getElementById('k-average').textContent = money.format(revenue / (shipped.length || 1));
document.getElementById('k-shipped').textContent = shipped.length;
// Bar chart on a canvas
function drawChart() {
const canvas = document.getElementById('chart');
const ctx = canvas.getContext('2d');
const { width, height } = canvas;
const max = Math.max(...monthly.map((m) => m[1]));
const slot = width / monthly.length;
ctx.clearRect(0, 0, width, height);
ctx.font = '14px system-ui, sans-serif';
ctx.textAlign = 'center';
monthly.forEach(([label, value], i) => {
const barHeight = (value / max) * (height - 50);
const x = i * slot + slot * 0.2;
ctx.fillStyle = '#c00000';
ctx.fillRect(x, height - 30 - barHeight, slot * 0.6, barHeight);
ctx.fillStyle = '#5a6670';
ctx.fillText(label, x + slot * 0.3, height - 8);
ctx.fillStyle = '#141c20';
ctx.fillText(Math.round(value / 100) / 10 + 'k', x + slot * 0.3, height - 36 - barHeight);
});
}
drawChart();
// Table: search and sort
const body = document.getElementById('rows');
const search = document.getElementById('search');
let sortKey = 'id';
let sortDir = 'desc';
function render() {
const term = search.value.trim().toLowerCase();
const rows = orders
.filter((o) => !term || o.customer.toLowerCase().includes(term) || o.status.includes(term))
.sort((a, b) => {
const result = a[sortKey] > b[sortKey] ? 1 : a[sortKey] < b[sortKey] ? -1 : 0;
return sortDir === 'asc' ? result : -result;
});
body.replaceChildren(...rows.map((o) => {
const tr = document.createElement('tr');
const status = document.createElement('span');
status.className = 'pill ' + o.status;
status.textContent = o.status;
const cells = ['#' + o.id, o.customer, money.format(o.amount)].map((text) => {
const td = document.createElement('td');
td.textContent = text;
return td;
});
const last = document.createElement('td');
last.append(status);
tr.append(...cells, last);
return tr;
}));
document.querySelectorAll('th button').forEach((b) => {
if (b.dataset.sort === sortKey) b.dataset.dir = sortDir; else delete b.dataset.dir;
});
}
document.querySelectorAll('th button').forEach((button) => {
button.addEventListener('click', () => {
const key = button.dataset.sort;
sortDir = key === sortKey && sortDir === 'asc' ? 'desc' : 'asc';
sortKey = key;
render();
});
});
search.addEventListener('input', render);
render();
:root { --ink: #141c20; --muted: #5a6670; --line: #e3e6e9; --bg: #f4f5f7; --card: #fff; --brand: #c00000; --side: #141c20; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); }
.layout { display: grid; grid-template-columns: 14rem 1fr; min-height: 100vh; }
.layout.collapsed { grid-template-columns: 0 1fr; }
.layout.collapsed .side { visibility: hidden; }
.side { background: var(--side); color: #fff; padding: 1rem; }
.logo { font-weight: 700; margin-bottom: 1.5rem; font-size: 1.1rem; }
.side nav { display: grid; gap: 0.25rem; }
.side a { color: #cfd6da; text-decoration: none; padding: 0.55rem 0.8rem; border-radius: 0.5rem; }
.side a:hover, .side a.active { background: rgb(255 255 255 / 0.1); color: #fff; }
.content { min-width: 0; }
.head { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); }
.head h1 { margin: 0; font-size: 1.3rem; }
button { font: inherit; cursor: pointer; }
#menu { padding: 0.35rem 0.8rem; border: 1px solid var(--line); border-radius: 0.5rem; background: transparent; }
main { padding: 1.5rem; display: grid; gap: 1.2rem; }
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.kpis article { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 1rem; }
.kpis span { display: block; color: var(--muted); font-size: 0.85rem; }
.kpis strong { font-size: 1.6rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 1rem; }
.panel h2 { margin: 0 0 0.8rem; font-size: 1.05rem; }
canvas { width: 100%; height: auto; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.search { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.search input { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 0.5rem; font: inherit; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th button { border: 0; background: none; font-weight: 700; padding: 0; }
th button[data-dir='asc']::after { content: ' \25B2'; font-size: 0.7em; }
th button[data-dir='desc']::after { content: ' \25BC'; font-size: 0.7em; }
.pill { padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; background: #eef0f2; }
.pill.shipped { background: #dff5e8; color: #0a6a35; }
.pill.pending { background: #fff1d6; color: #8a5a00; }
.pill.cancelled { background: #fde2e2; color: #a40000; }
@media (max-width: 40rem) {
.layout { grid-template-columns: 1fr; }
.side { display: none; }
.layout:not(.collapsed) .side { display: block; }
}
First release.