Snippets Admin

Bootstrap 5 Responsive Admin Panel Layout

A responsive admin panel with a collapsible sidebar, summary stat cards, a sales table and an income form, using an offcanvas menu on small screens.

Bootstrap 5 No jQuery Jan 2020 2.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:1120px">
    <div class="wdw-card adm overflow-hidden">
      <div class="d-lg-flex">
        <aside class="adm-side offcanvas-lg offcanvas-start border-end" tabindex="-1" id="admSide" aria-labelledby="admSideTitle">
          <div class="offcanvas-header d-lg-none"><span class="fw-bold" id="admSideTitle">Menu</span><button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#admSide" aria-label="Close"></button></div>
          <div class="offcanvas-body d-flex flex-column p-3 p-lg-4">
            <div class="d-flex align-items-center gap-2 mb-4 px-2"><span class="wdw-icon" style="width:2.25rem;height:2.25rem"><i class="bi bi-bar-chart-fill"></i></span><strong class="wdw-heading">Northwind</strong></div>
            <p class="wdw-eyebrow px-2 mb-2">Main</p>
            <nav class="nav flex-column gap-1" id="admNav" aria-label="Admin">
              <a class="nav-link active" href="#" aria-current="page"><i class="bi bi-grid-1x2"></i> Dashboard</a>
              <a class="nav-link" href="#"><i class="bi bi-box"></i> Components <span class="badge rounded-pill text-bg-primary ms-auto">12</span></a>
              <a class="nav-link" href="#sub-widgets" data-bs-toggle="collapse" aria-expanded="false" aria-controls="sub-widgets"><i class="bi bi-puzzle"></i> Widgets <i class="bi bi-chevron-right caret ms-auto"></i></a>
              <div class="collapse" id="sub-widgets"><div class="nav flex-column sub"><a class="nav-link" href="#">Charts</a><a class="nav-link" href="#">Maps</a></div></div>
              <a class="nav-link" href="#"><i class="bi bi-activity"></i> Metrics</a>
              <a class="nav-link" href="#sub-tables" data-bs-toggle="collapse" aria-expanded="false" aria-controls="sub-tables"><i class="bi bi-table"></i> Tables <i class="bi bi-chevron-right caret ms-auto"></i></a>
              <div class="collapse" id="sub-tables"><div class="nav flex-column sub"><a class="nav-link" href="#">Basic</a><a class="nav-link" href="#">Data grid</a></div></div>
              <a class="nav-link" href="#"><i class="bi bi-clock-history"></i> Timeline</a>
            </nav>
            <div class="mt-auto pt-4">
              <div class="rounded-4 bg-primary-subtle p-3">
                <div class="d-flex align-items-center gap-2 mb-2"><i class="bi bi-stars text-primary"></i><strong class="small">Pro plan</strong></div>
                <div class="progress mb-2" style="height:6px" role="progressbar" aria-label="Plan usage" aria-valuenow="68" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar" style="width:68%"></div></div>
                <small class="text-body-secondary">68% of monthly quota used</small>
              </div>
            </div>
          </div>
        </aside>
        <main class="flex-grow-1 p-3 p-lg-4 bg-body-tertiary adm-main">
          <div class="d-flex align-items-center gap-3 mb-4">
            <button class="btn btn-outline-secondary d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#admSide" aria-controls="admSide" aria-label="Open menu"><i class="bi bi-list fs-5"></i></button>
            <div><h1 class="h3 wdw-heading mb-0">Dashboard</h1><span class="text-body-secondary">Sales overview</span></div>
            <img class="rounded-circle ms-auto" width="44" height="44" src="https://i.pravatar.cc/80?img=32" alt="Account">
          </div>
          <div class="row g-3 mb-3">
            <div class="col-sm-4"><div class="wdw-card-sm p-3 p-xl-4">
              <div class="d-flex align-items-center gap-3 mb-3"><span class="wdw-icon"><i class="bi bi-wallet2"></i></span><span class="text-body-secondary fw-semibold">Total revenue</span></div>
              <div class="d-flex align-items-end justify-content-between gap-2">
                <div><div class="adm-stat fw-bold lh-1 mb-2">$2,223</div><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><i class="bi bi-arrow-up-right"></i> 12%</span></div>
                <svg class="spark" viewBox="0 0 80 32" width="80" height="32" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="0,24 14,20 28,22 42,12 56,14 70,4 80,6"/></svg>
              </div></div></div>
            <div class="col-sm-4"><div class="wdw-card-sm p-3 p-xl-4">
              <div class="d-flex align-items-center gap-3 mb-3"><span class="wdw-icon"><i class="bi bi-bag-check"></i></span><span class="text-body-secondary fw-semibold">Orders</span></div>
              <div class="d-flex align-items-end justify-content-between gap-2">
                <div><div class="adm-stat fw-bold lh-1 mb-2">418</div><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><i class="bi bi-arrow-up-right"></i> 4%</span></div>
                <svg class="spark" viewBox="0 0 80 32" width="80" height="32" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="0,20 14,22 28,14 42,18 56,10 70,12 80,6"/></svg>
              </div></div></div>
            <div class="col-sm-4"><div class="wdw-card-sm p-3 p-xl-4">
              <div class="d-flex align-items-center gap-3 mb-3"><span class="wdw-icon"><i class="bi bi-arrow-return-left"></i></span><span class="text-body-secondary fw-semibold">Refunds</span></div>
              <div class="d-flex align-items-end justify-content-between gap-2">
                <div><div class="adm-stat fw-bold lh-1 mb-2">9</div><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis"><i class="bi bi-arrow-down-right"></i> 2%</span></div>
                <svg class="spark" viewBox="0 0 80 32" width="80" height="32" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="0,6 14,10 28,8 42,16 56,14 70,22 80,24"/></svg>
              </div></div></div>
          </div>
          <div class="row g-3 mb-3">
            <div class="col-xl-7">
              <div class="wdw-card-sm p-3 p-xl-4 h-100">
                <div class="d-flex align-items-center mb-3"><h2 class="h5 fw-bold mb-0">Sales by month</h2><span class="ms-auto small text-body-secondary">2026</span></div>
                <svg class="chart w-100 mb-3" viewBox="0 0 360 110" preserveAspectRatio="none" role="img" aria-label="Bar chart of monthly sales, rising from January to June" fill="currentColor">
                  <rect x="10" y="62" width="40" height="48" rx="6" opacity=".35"/><rect x="70" y="48" width="40" height="62" rx="6" opacity=".45"/><rect x="130" y="55" width="40" height="55" rx="6" opacity=".55"/><rect x="190" y="30" width="40" height="80" rx="6" opacity=".7"/><rect x="250" y="38" width="40" height="72" rx="6" opacity=".85"/><rect x="310" y="8" width="40" height="102" rx="6"/>
                </svg>
                <div class="table-responsive">
                  <table class="table align-middle mb-0">
                    <thead><tr><th scope="col">Month</th><th scope="col">T-shirts</th><th scope="col">Pants</th><th scope="col">Hoodies</th><th scope="col">Status</th></tr></thead>
                    <tbody>
                      <tr><th scope="row">January</th><td>$300</td><td>$758</td><td>$314</td><td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Closed</span></td></tr>
                      <tr><th scope="row">February</th><td>$453</td><td>$159</td><td>$239</td><td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Closed</span></td></tr>
                      <tr><th scope="row">March</th><td>$512</td><td>$402</td><td>$388</td><td><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis">Open</span></td></tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
            <div class="col-xl-5">
              <form class="wdw-card-sm p-3 p-xl-4 h-100" id="admForm">
                <h2 class="h5 fw-bold mb-3">Add income</h2>
                <label class="form-label" for="admMonth">Month</label>
                <select id="admMonth" class="form-select mb-3"><option>January</option><option>February</option><option>March</option></select>
                <div class="row g-2 mb-3">
                  <div class="col-4"><label class="form-label" for="i1">T-shirts</label><input id="i1" class="form-control" inputmode="numeric" placeholder="$0"></div>
                  <div class="col-4"><label class="form-label" for="i2">Pants</label><input id="i2" class="form-control" inputmode="numeric" placeholder="$0"></div>
                  <div class="col-4"><label class="form-label" for="i3">Hoodies</label><input id="i3" class="form-control" inputmode="numeric" placeholder="$0"></div>
                </div>
                <button class="btn btn-primary rounded-pill px-4" type="submit">Save</button>
              </form>
            </div>
          </div>
          <div class="wdw-card-sm p-3 p-xl-4">
            <h2 class="h5 fw-bold mb-3">Last 5 sales</h2>
            <div class="table-responsive">
              <table class="table align-middle mb-0">
                <thead><tr><th scope="col">Customer</th><th scope="col">Item</th><th scope="col">Amount</th><th scope="col">Status</th></tr></thead>
                <tbody>
                  <tr><th scope="row">Maya Patel</th><td>Hoodie</td><td>$68</td><td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Paid</span></td></tr>
                  <tr><th scope="row">Tomas Berg</th><td>T-shirt</td><td>$24</td><td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Paid</span></td></tr>
                  <tr><th scope="row">Priya Nair</th><td>Pants</td><td>$54</td><td><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis">Pending</span></td></tr>
                  <tr><th scope="row">Jon Ellis</th><td>Hoodie</td><td>$68</td><td><span class="badge rounded-pill bg-success-subtle text-success-emphasis">Paid</span></td></tr>
                  <tr><th scope="row">Ana Silva</th><td>T-shirt</td><td>$24</td><td><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis">Refunded</span></td></tr>
                </tbody>
              </table>
            </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.