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.
<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>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.app-shell { min-height: 560px; }
.app-side { width: 232px; flex: none; }
.app-side .nav-link { border-radius: .75rem; min-height: 44px; }
.app-side .nav-link:not(.active):hover { background: var(--bs-secondary-bg); }
.wdw-min0 { min-width: 0; }
.app-shell thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); font-weight: 700; }
@media (max-width: 767.98px) {
.app-side { width: 68px; padding-inline: .5rem !important; align-items: center; }
.app-side .nav-link { justify-content: center; padding-inline: 0; width: 48px; }
}
.state-dot { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; }
.app-icon-btn { display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 0; }
.app-filter { border-color: var(--bs-border-color-translucent); color: var(--bs-body-color); }
[data-bs-theme="dark"] .app-filter, [data-bs-theme="dark"] .app-icon-btn { display: inline-grid; border-color: var(--bs-gray-500); color: var(--bs-body-color); }
.app-shell tbody tr:hover > * { background: var(--bs-primary-bg-subtle); }
.app-shell .table > :not(caption) > * > * { padding-block: .85rem; }
@media (max-width: 767.98px) {
.app-side .side-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
function initSideNav() {
const nav = document.getElementById('sideNav');
if (!nav) return;
nav.addEventListener('click', (e) => {
const link = e.target.closest('.nav-link');
if (!link) return;
e.preventDefault();
nav.querySelectorAll('.nav-link').forEach((l) => { l.classList.remove('active'); l.removeAttribute('aria-current'); });
link.classList.add('active');
link.setAttribute('aria-current', 'page');
});
}
function initRowFilter() {
const input = document.getElementById('rowFilter');
const rows = document.querySelectorAll('#rows tr');
if (!input) return;
input.addEventListener('input', () => {
const q = input.value.trim().toLowerCase();
rows.forEach((r) => { r.hidden = q && !r.textContent.toLowerCase().includes(q); });
});
}
initSideNav();
initRowFilter();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.