Snippets Admin

Bootstrap 5 Admin Dashboard with Collapsible Sidebar

An admin dashboard shell with a collapsible icon sidebar and tooltips, a top bar with search and notification badges, stat cards, a trend chart and an activity feed.

Bootstrap 5 No jQuery Jan 2020 3.8K views

<section class="wdw-stage">
  <div class="container" style="max-width:1180px">
    <div class="wdw-card overflow-hidden db-app" id="dbApp">
      <div class="db-backdrop" id="dbBackdrop" hidden></div>
      <aside class="db-side" id="dbSide" aria-label="Sidebar">
        <div class="db-logo"><span class="db-mark">D</span><span class="db-text fw-bold">Dashkit</span></div>
        <ul class="list-unstyled mb-0 p-2 d-grid gap-1">
<li><a href="#" class="db-link active" data-label="Flights" aria-label="Flights" aria-current="page"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m22 2-7 20-4-9-9-4z"/><path d="M22 2 11 13"/></svg><span class="db-text">Flights</span></a></li>
<li><a href="#" class="db-link" data-label="Modules" aria-label="Modules"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></svg><span class="db-text">Modules</span></a></li>
<li><a href="#" class="db-link" data-label="Statistics" aria-label="Statistics"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3v18h18"/><path d="M7 15l4-4 3 3 5-6"/></svg><span class="db-text">Statistics</span></a></li>
<li><a href="#" class="db-link" data-label="Gifts" aria-label="Gifts"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="8" width="18" height="4" rx="1"/><path d="M12 8v13M19 12v9H5v-9M7.5 8a2.5 2.5 0 0 1 0-5C11 3 12 8 12 8s1-5 4.5-5a2.5 2.5 0 0 1 0 5"/></svg><span class="db-text">Gifts</span></a></li>
<li><a href="#" class="db-link" data-label="Settings" aria-label="Settings"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.100 2.100M17 17l2.100 2.100M4.900 19.100 7 17M17 7l2.100-2.100"/></svg><span class="db-text">Settings</span></a></li>
        </ul>
      </aside>
      <div class="db-main">
        <header class="db-top">
          <button type="button" class="db-ico" id="dbToggle" aria-label="Toggle sidebar" aria-controls="dbSide" aria-expanded="false"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6h16M4 12h10M4 18h16"/></svg></button>
          <button type="button" class="db-ico position-relative d-none d-sm-inline-flex" aria-label="Notifications, 13 unread"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9M13.700 21a2 2 0 0 1-3.400 0"/></svg><span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger" aria-hidden="true">13</span></button>
          <label class="db-search flex-grow-1"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.300-4.300"/></svg><span class="visually-hidden">Search</span><input type="search" class="form-control border-0 bg-transparent shadow-none" placeholder="Search"></label>
          <button type="button" class="db-ico position-relative" aria-label="Orders, 4 new"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.700 13.400a2 2 0 0 0 2 1.600h9.700a2 2 0 0 0 2-1.600L23 6H6"/></svg><span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-primary" aria-hidden="true">4</span></button>
          <button type="button" class="db-ico d-none d-sm-inline-flex" aria-label="Sign out"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2v10M18.400 6.600a9 9 0 1 1-12.800 0"/></svg></button>
        </header>
        <main class="db-content p-3 p-lg-4 d-flex flex-column">
          <div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3">
            <div><h2 class="wdw-heading h4 mb-0">Dashboard</h2><p class="small wdw-muted mb-0">Welcome back, here is today's overview.</p></div>
            <button class="btn btn-primary btn-sm rounded-pill px-3">New report</button>
          </div>
          <div class="row g-3 mb-3">
<div class="col-6 col-xl-3"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted mb-1">Revenue</div><div class="fs-4 fw-bold wdw-heading">$48,290</div><span class="badge rounded-pill bg-success-subtle text-success-emphasis mt-1">+12.4%</span></div></div>
<div class="col-6 col-xl-3"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted mb-1">Active users</div><div class="fs-4 fw-bold wdw-heading">8,402</div><span class="badge rounded-pill bg-success-subtle text-success-emphasis mt-1">+4.1%</span></div></div>
<div class="col-6 col-xl-3"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted mb-1">Bookings</div><div class="fs-4 fw-bold wdw-heading">1,284</div><span class="badge rounded-pill bg-success-subtle text-success-emphasis mt-1">+8.9%</span></div></div>
<div class="col-6 col-xl-3"><div class="wdw-card-sm p-3 h-100"><div class="small wdw-muted mb-1">Refunds</div><div class="fs-4 fw-bold wdw-heading">23</div><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis mt-1">-2.3%</span></div></div>
          </div>
          <div class="row g-3 flex-grow-1">
            <div class="col-lg-7"><div class="wdw-card-sm p-3 h-100 d-flex flex-column">
              <div class="d-flex justify-content-between align-items-center gap-2 mb-2 flex-wrap">
                <div class="fw-bold">Bookings</div>
                <div class="btn-group btn-group-sm" role="group" aria-label="Chart range">
                  <input type="radio" class="btn-check" name="dbRange" id="dbR7" value="7" checked><label class="btn btn-outline-primary rounded-start-pill px-3" for="dbR7">7d</label>
                  <input type="radio" class="btn-check" name="dbRange" id="dbR30" value="30"><label class="btn btn-outline-primary rounded-end-pill px-3" for="dbR30">30d</label>
                </div>
              </div>
              <div class="db-chart-wrap flex-grow-1" id="dbChart" role="img" aria-label="Bookings per day for the selected range"></div>
            </div></div>
            <div class="col-lg-5"><div class="wdw-card-sm p-3 h-100">
              <div class="fw-bold mb-1">Recent activity</div>
              <ul class="list-unstyled mb-0">
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-success flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Success:</span><span class="flex-grow-1 small fw-semibold">Flight LV-218 confirmed</span><span class="small wdw-muted">2 min ago</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-primary flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Info:</span><span class="flex-grow-1 small fw-semibold">New payment from Acme Co.</span><span class="small wdw-muted">18 min ago</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-warning flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Warning:</span><span class="flex-grow-1 small fw-semibold">Module update available</span><span class="small wdw-muted">1 hour ago</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-danger flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Alert:</span><span class="flex-grow-1 small fw-semibold">Refund requested</span><span class="small wdw-muted">3 hours ago</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-success flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Success:</span><span class="flex-grow-1 small fw-semibold">Payout of $3,200 sent</span><span class="small wdw-muted">5 hours ago</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-primary flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Info:</span><span class="flex-grow-1 small fw-semibold">Maya joined the team</span><span class="small wdw-muted">Yesterday</span></li>
<li class="d-flex align-items-center gap-3 py-2"><span class="rounded-circle bg-warning flex-none" style="width:.6rem;height:.6rem" aria-hidden="true"></span><span class="visually-hidden">Warning:</span><span class="flex-grow-1 small fw-semibold">Seat limit almost reached</span><span class="small wdw-muted">Yesterday</span></li>
              </ul>
            </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.