Snippets Admin

Bootstrap 5 Dashboard Layout with Sidebar and Data Table

A dashboard shell with a collapsible icon sidebar, toolbar and a searchable articles table with status badges.

Bootstrap 5 No jQuery Jan 2020 2.2K views

<section class="wdw-stage"><div class="container" style="max-width:1080px">
<div class="app-shell wdw-card overflow-hidden d-flex">
<aside class="app-side border-end bg-body-tertiary d-flex flex-column p-3" aria-label="Admin sidebar">
<a href="#" class="d-flex align-items-center gap-2 fw-bold text-body-emphasis text-decoration-none px-2 py-2 mb-3"><span class="wdw-icon" style="width:2.25rem;height:2.25rem;border-radius:.7rem"><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 3l9 5-9 5-9-5z"/><path d="M3 13l9 5 9-5"/></svg></span><span class="side-label">Dashboard UI</span></a>
<nav class="nav nav-pills flex-column gap-1" id="sideNav" aria-label="Content sections">
<a class="nav-link d-flex align-items-center gap-3 active" href="#" aria-current="page" aria-label="Dashboard"><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="3" y="3" width="7" height="9" rx="1.5"/><rect x="14" y="3" width="7" height="5" rx="1.5"/><rect x="14" y="12" width="7" height="9" rx="1.5"/><rect x="3" y="16" width="7" height="5" rx="1.5"/></svg><span class="side-label">Dashboard</span></a>
<a class="nav-link d-flex align-items-center gap-3" href="#" aria-label="Articles"><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="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5M9 13h6M9 17h6"/></svg><span class="side-label">Articles</span></a>
<a class="nav-link d-flex align-items-center gap-3" href="#" aria-label="Categories"><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="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg><span class="side-label">Categories</span></a>
<a class="nav-link d-flex align-items-center gap-3" href="#" aria-label="Countries"><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="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg><span class="side-label">Countries</span></a>
<a class="nav-link d-flex align-items-center gap-3" href="#" aria-label="Users"><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><span class="side-label">Users</span></a>
<a class="nav-link d-flex align-items-center gap-3" href="#" aria-label="Tools"><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="M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.4-.6-.6-2.4z"/></svg><span class="side-label">Tools</span></a>
</nav>
<div class="side-label mt-auto small wdw-muted px-2 pt-3">v2.4 · All systems normal</div>
</aside>
<div class="flex-grow-1 wdw-min0 d-flex flex-column">
<header class="d-flex align-items-center justify-content-end gap-3 px-3 px-md-4 py-3 border-bottom"><button class="btn btn-sm btn-outline-secondary rounded-circle app-icon-btn" type="button" aria-label="Settings"><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="M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0"/><circle cx="16" cy="6" r="2"/><circle cx="10" cy="12" r="2"/><circle cx="18" cy="18" r="2"/></svg></button><img src="https://i.pravatar.cc/80?img=12" width="40" height="40" class="rounded-circle" alt="Signed in as Alex Morgan"></header>
<div class="p-3 p-md-4 d-flex flex-column gap-3 flex-grow-1">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3"><h2 class="wdw-heading h3 mb-0">Articles</h2>
<div class="d-flex flex-wrap gap-2"><label class="visually-hidden" for="rowFilter">Filter articles</label><input id="rowFilter" type="search" class="form-control rounded-pill" style="width:200px" placeholder="Search articles">
<button class="btn btn-primary rounded-pill px-4" type="button">New</button><button class="btn btn-outline-secondary app-filter rounded-pill" type="button">Filters</button></div></div>
<div class="row g-2 g-md-3"><div class="col-4"><div class="border rounded-4 p-2 p-md-3 h-100 bg-body"><div class="small wdw-muted text-truncate">Published</div><div class="fs-4 fw-bold text-body-emphasis lh-1 my-1">128</div><div class="small text-success">+12 this month</div></div></div><div class="col-4"><div class="border rounded-4 p-2 p-md-3 h-100 bg-body"><div class="small wdw-muted text-truncate">In review</div><div class="fs-4 fw-bold text-body-emphasis lh-1 my-1">14</div><div class="small text-warning-emphasis">3 need legal</div></div></div><div class="col-4"><div class="border rounded-4 p-2 p-md-3 h-100 bg-body"><div class="small wdw-muted text-truncate">Drafts</div><div class="fs-4 fw-bold text-body-emphasis lh-1 my-1">32</div><div class="small text-body-secondary">5 stale</div></div></div></div>
<div class="border rounded-4 overflow-hidden"><div class="table-responsive"><table class="table table-hover align-middle mb-0 small"><thead><tr><th scope="col" class="ps-3">Title</th><th scope="col" class="d-none d-sm-table-cell">Author</th><th scope="col" class="d-none d-sm-table-cell">State</th><th scope="col" class="d-none d-md-table-cell">Type</th><th scope="col" class="d-none d-lg-table-cell">Date</th><th scope="col" class="d-none d-lg-table-cell">Country</th></tr></thead><tbody id="rows">
<tr><td class="ps-3 py-3"><div class="d-flex align-items-center gap-2"><img src="https://i.pravatar.cc/64?img=12" width="32" height="32" class="rounded-circle flex-shrink-0 d-none d-sm-block" alt=""><div class="wdw-min0"><div class="fw-semibold text-body-emphasis">Rethinking onboarding flows</div><div class="d-sm-none mt-1"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-warning" aria-hidden="true"></span>Legal Review</span></div></div></div></td><td class="d-none d-sm-table-cell">Joe Bloggs</td><td class="d-none d-sm-table-cell"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-warning" aria-hidden="true"></span>Legal Review</span></td><td class="d-none d-md-table-cell">Published</td><td class="d-none d-lg-table-cell text-body-secondary">2016-05-07</td><td class="d-none d-lg-table-cell text-body-secondary">United Kingdom</td></tr>
<tr><td class="ps-3 py-3"><div class="d-flex align-items-center gap-2"><img src="https://i.pravatar.cc/64?img=5" width="32" height="32" class="rounded-circle flex-shrink-0 d-none d-sm-block" alt=""><div class="wdw-min0"><div class="fw-semibold text-body-emphasis">Design tokens in practice</div><div class="d-sm-none mt-1"><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-secondary" aria-hidden="true"></span>Edit</span></div></div></div></td><td class="d-none d-sm-table-cell">Jane Bloggs</td><td class="d-none d-sm-table-cell"><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-secondary" aria-hidden="true"></span>Edit</span></td><td class="d-none d-md-table-cell">Draft</td><td class="d-none d-lg-table-cell text-body-secondary">2015-05-07</td><td class="d-none d-lg-table-cell text-body-secondary">Scotland</td></tr>
<tr><td class="ps-3 py-3"><div class="d-flex align-items-center gap-2"><img src="https://i.pravatar.cc/64?img=47" width="32" height="32" class="rounded-circle flex-shrink-0 d-none d-sm-block" alt=""><div class="wdw-min0"><div class="fw-semibold text-body-emphasis">Shipping a calmer inbox</div><div class="d-sm-none mt-1"><span class="badge rounded-pill bg-success-subtle text-success-emphasis border border-success-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-success" aria-hidden="true"></span>Approved</span></div></div></div></td><td class="d-none d-sm-table-cell">Maria Lopez</td><td class="d-none d-sm-table-cell"><span class="badge rounded-pill bg-success-subtle text-success-emphasis border border-success-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-success" aria-hidden="true"></span>Approved</span></td><td class="d-none d-md-table-cell">Published</td><td class="d-none d-lg-table-cell text-body-secondary">2026-03-18</td><td class="d-none d-lg-table-cell text-body-secondary">Spain</td></tr>
<tr><td class="ps-3 py-3"><div class="d-flex align-items-center gap-2"><img src="https://i.pravatar.cc/64?img=33" width="32" height="32" class="rounded-circle flex-shrink-0 d-none d-sm-block" alt=""><div class="wdw-min0"><div class="fw-semibold text-body-emphasis">Dark mode without regrets</div><div class="d-sm-none mt-1"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-warning" aria-hidden="true"></span>Legal Review</span></div></div></div></td><td class="d-none d-sm-table-cell">Kenji Sato</td><td class="d-none d-sm-table-cell"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-warning" aria-hidden="true"></span>Legal Review</span></td><td class="d-none d-md-table-cell">In review</td><td class="d-none d-lg-table-cell text-body-secondary">2026-04-02</td><td class="d-none d-lg-table-cell text-body-secondary">Japan</td></tr>
<tr><td class="ps-3 py-3"><div class="d-flex align-items-center gap-2"><img src="https://i.pravatar.cc/64?img=68" width="32" height="32" class="rounded-circle flex-shrink-0 d-none d-sm-block" alt=""><div class="wdw-min0"><div class="fw-semibold text-body-emphasis">A field guide to grids</div><div class="d-sm-none mt-1"><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-secondary" aria-hidden="true"></span>Edit</span></div></div></div></td><td class="d-none d-sm-table-cell">Anna Berg</td><td class="d-none d-sm-table-cell"><span class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle d-inline-flex align-items-center gap-1"><span class="state-dot bg-secondary" aria-hidden="true"></span>Edit</span></td><td class="d-none d-md-table-cell">Draft</td><td class="d-none d-lg-table-cell text-body-secondary">2026-05-11</td><td class="d-none d-lg-table-cell text-body-secondary">Sweden</td></tr>
</tbody></table></div>
<div class="d-flex align-items-center justify-content-between gap-2 px-3 py-2 border-top small bg-body-tertiary"><span class="wdw-muted">Showing 1-5 of 24</span><div class="btn-group btn-group-sm"><button class="btn btn-outline-secondary" type="button" disabled>Previous</button><button class="btn btn-outline-secondary" type="button">Next</button></div></div></div></div></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.