Snippets Admin

Bootstrap 5 Admin Panel Layout with Charts and KPI Cards

An admin panel with a top bar, side navigation, a revenue line chart with a date-range switch and three KPI cards with sparklines.

Bootstrap 5 No jQuery Jan 2020 2.2K views

<section class="wdw-stage"><div class="container" style="max-width:1120px">
<div class="admin wdw-card overflow-hidden">
<header class="d-flex align-items-center gap-3 px-3 px-md-4 py-3 admin-top text-white"><span class="d-flex align-items-center gap-2 fw-bold fs-5"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><path d="M12 4l9 16H3z"/></svg>Backend</span><span class="small opacity-75 ms-md-4 d-none d-sm-inline">Overview</span><img src="https://i.pravatar.cc/64?img=32" width="36" height="36" class="rounded-circle ms-auto" alt="Signed in as Priya N."></header>
<div class="d-flex flex-column flex-md-row">
<nav class="admin-side p-2 p-md-3 d-flex flex-md-column gap-1 overflow-auto" aria-label="Admin"><div class="nav nav-pills flex-md-column flex-nowrap gap-1 w-100" id="adminNav"><a class="nav-link text-nowrap d-flex align-items-center gap-2 active" href="#" aria-current="page"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>Dashboard</a><a class="nav-link text-nowrap d-flex align-items-center gap-2" href="#"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><rect x="2.5" y="5" width="19" height="14" rx="2.5"/><path d="M2.5 10h19"/></svg>Bills & Payments</a><a class="nav-link text-nowrap d-flex align-items-center gap-2" href="#"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><circle cx="9" cy="8" r="3.5"/><path d="M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5"/></svg>Customers</a><a class="nav-link text-nowrap d-flex align-items-center gap-2" href="#"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><circle cx="12" cy="12" r="9"/><path d="M12 7.5v5M12 16h.01"/></svg>Server Logs</a></div></nav>
<main class="flex-grow-1 wdw-min0 p-3 p-md-4 bg-body-tertiary d-flex flex-column gap-3">
<div class="wdw-card-sm p-3 p-md-4">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-2"><div><h2 class="h6 mb-0 text-body-emphasis">Revenue</h2><p class="small wdw-muted mb-0">Daily income, USD</p></div>
<div class="btn-group" role="group" aria-label="Date range" id="rangeGroup"><input type="radio" class="btn-check" name="range" id="r14" value="14" autocomplete="off"><label class="btn btn-outline-primary btn-sm rounded-start-pill px-3" for="r14">14D</label><input type="radio" class="btn-check" name="range" id="r30" value="30" autocomplete="off" checked><label class="btn btn-outline-primary btn-sm px-3" for="r30">30D</label><input type="radio" class="btn-check" name="range" id="r60" value="60" autocomplete="off"><label class="btn btn-outline-primary btn-sm rounded-end-pill px-3" for="r60">60D</label></div></div>
<div id="bigChart" class="chart-big" role="img" aria-label="Line chart of daily revenue"></div></div>
<div class="row g-3">
<div class="col-12 col-sm-4"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted">Sales</div><div class="d-flex align-items-baseline gap-2"><span class="h4 wdw-heading mb-0">$424,632</span><span class="small fw-semibold text-success">+12.4%</span></div><div class="spark mt-2" data-spark="Sales"></div></div></div>
<div class="col-12 col-sm-4"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted">Expenses</div><div class="d-flex align-items-baseline gap-2"><span class="h4 wdw-heading mb-0">$235,312</span><span class="small fw-semibold text-danger">+3.1%</span></div><div class="spark mt-2" data-spark="Expenses"></div></div></div>
<div class="col-12 col-sm-4"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted">Profits</div><div class="d-flex align-items-baseline gap-2"><span class="h4 wdw-heading mb-0">$135,965</span><span class="small fw-semibold text-success">+18.9%</span></div><div class="spark mt-2" data-spark="Profits"></div></div></div>
</div></main></div></div></div></section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.