Bootstrap 5 Navbar with Search Bar and Notifications
A storefront navbar with a rounded search field, category links with a dropdown, a notifications menu and a login button, collapsing to a stacked mobile layout.
<section class="wdw-stage">
<div class="container" style="max-width:1080px">
<div class="wdw-card">
<header class="shop-nav rounded-top-4">
<div class="d-flex align-items-center gap-3 px-3 px-md-4 py-3">
<a href="#" class="d-flex align-items-center gap-2 text-decoration-none fw-bold fs-5 text-body-emphasis me-md-2">
<span class="wdw-icon" style="width:2.25rem;height:2.25rem;border-radius:.65rem" aria-hidden="true">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="12" rx="2"/><path d="M2 20h20"/></svg>
</span>
Lapstore
</a>
<form class="shop-search d-none d-md-block flex-grow-1" role="search" onsubmit="return false">
<label for="shopSearch" class="visually-hidden">Search products</label>
<div class="position-relative">
<svg class="shop-search-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
<input id="shopSearch" type="search" class="form-control rounded-pill ps-5 bg-body-tertiary border-0" placeholder="Search laptops, phones, accessories" autocomplete="off">
<kbd class="shop-kbd d-none d-lg-inline">/</kbd>
</div>
</form>
<div class="d-flex align-items-center gap-2 ms-auto">
<div class="dropdown">
<button class="btn btn-icon rounded-circle position-relative" type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false" aria-label="Notifications, 3 new">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.9 1.9 0 0 0 3.4 0"/></svg>
<span class="position-absolute top-0 end-0 mt-1 me-1 p-1 bg-danger rounded-circle shop-dot"></span>
</button>
<div class="dropdown-menu dropdown-menu-end p-2 shop-menu">
<div class="px-3 pt-2 pb-1 wdw-eyebrow">Latest updates</div>
<a class="dropdown-item d-flex gap-3 align-items-start rounded-3 py-2" href="#"><span class="wdw-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 12v9H4v-9M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7z"/></svg></span><span><span class="d-block fw-semibold">Your order has shipped</span><small class="text-body-secondary text-wrap">MacBook Air arrives Thursday</small></span></a>
<a class="dropdown-item d-flex gap-3 align-items-start rounded-3 py-2" href="#"><span class="wdw-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8z"/><circle cx="7" cy="7" r="1.2"/></svg></span><span><span class="d-block fw-semibold">Price drop on your wishlist</span><small class="text-body-secondary text-wrap">ThinkPad X1 is now 15% off</small></span></a>
<a class="dropdown-item d-flex gap-3 align-items-start rounded-3 py-2" href="#"><span class="wdw-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="6"/><path d="m8.2 13.5-1.2 8.5 5-3 5 3-1.2-8.5"/></svg></span><span><span class="d-block fw-semibold">New reward unlocked</span><small class="text-body-secondary text-wrap">Free shipping for 30 days</small></span></a>
</div>
</div>
<a href="#" class="btn btn-primary rounded-pill px-4">Log in</a>
</div>
</div>
<nav class="navbar navbar-expand-md border-top px-3 px-md-4 py-0" aria-label="Shop categories">
<form class="d-md-none w-100 my-2" role="search" onsubmit="return false">
<label for="shopSearchM" class="visually-hidden">Search products</label>
<input id="shopSearchM" type="search" class="form-control rounded-pill bg-body-tertiary border-0 px-4" placeholder="Search products">
</form>
<ul class="navbar-nav flex-row gap-1 py-2 shop-links">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle rounded-pill px-3 active" href="#" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false">Laptops</a>
<ul class="dropdown-menu shop-menu p-2">
<li><a class="dropdown-item rounded-3" href="#">Ultrabooks</a></li>
<li><a class="dropdown-item rounded-3" href="#">Gaming</a></li>
<li><a class="dropdown-item rounded-3" href="#">Workstations</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link rounded-pill px-3" href="#">Refurbished</a></li>
<li class="nav-item"><a class="nav-link rounded-pill px-3" href="#">Accessories</a></li>
<li class="nav-item"><a class="nav-link rounded-pill px-3" href="#">Blog</a></li>
<li class="nav-item"><a class="nav-link rounded-pill px-3" href="#">Support</a></li>
</ul>
</nav>
</header>
<div class="p-3 p-md-4 bg-body-tertiary shop-body">
<div class="row g-3">
<div class="col-md-7"><div class="wdw-aurora rounded-4 p-4 p-md-5 h-100"><span class="badge text-bg-light rounded-pill mb-3">Autumn sale</span><h2 class="h3 fw-bold mb-2">Up to 30% off ultrabooks</h2><p class="mb-4 opacity-75">Certified refurbished and brand new, with free two-day shipping.</p><a href="#" class="btn btn-light rounded-pill px-4">Shop laptops</a></div></div>
<div class="col-md-5 d-none d-md-block"><div class="wdw-card-sm p-3 h-100"><div class="wdw-eyebrow px-2 pt-1 pb-2">Featured this week</div><div class="d-flex flex-column gap-1"><a href="#" class="shop-pick d-flex align-items-center gap-3 text-decoration-none rounded-3 p-2"><span class="wdw-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="12" rx="2"/><path d="M2 20h20"/></svg></span><span class="flex-grow-1"><span class="d-block fw-semibold text-body-emphasis">MacBook Air 13</span><small class="text-body-secondary">M3 chip, 16 GB</small></span><span class="fw-semibold text-body-emphasis small">$999</span></a><a href="#" class="shop-pick d-flex align-items-center gap-3 text-decoration-none rounded-3 p-2"><span class="wdw-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="3"/><path d="M6 12h4M8 10v4M15 11h.01M18 13h.01"/></svg></span><span class="flex-grow-1"><span class="d-block fw-semibold text-body-emphasis">Legion Pro 5</span><small class="text-body-secondary">RTX 4070, 165 Hz</small></span><span class="fw-semibold text-body-emphasis small">$1,499</span></a><a href="#" class="shop-pick d-flex align-items-center gap-3 text-decoration-none rounded-3 p-2"><span class="wdw-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="3"/><path d="M11 18h2"/></svg></span><span class="flex-grow-1"><span class="d-block fw-semibold text-body-emphasis">Refurbished iPad Air</span><small class="text-body-secondary">Grade A, 1-year warranty</small></span><span class="fw-semibold text-body-emphasis small">$449</span></a></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 */
.shop-nav .btn-icon { width: 44px; padding: 0; color: var(--bs-body-color); }
.shop-nav .btn-icon:hover { background: var(--bs-tertiary-bg); }
.shop-search { max-width: 520px; }
.shop-search-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.shop-search .form-control { padding-right: 3rem; }
.shop-kbd { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); font-size: .75rem; padding: .1rem .5rem; border-radius: .4rem; background: var(--bs-body-bg); color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); }
.shop-links .nav-link { color: var(--bs-secondary-color); font-weight: 600; font-size: .9rem; min-height: 40px; display: flex; align-items: center; }
.shop-links .nav-link:hover { color: var(--bs-emphasis-color); background: var(--bs-tertiary-bg); }
.shop-links .nav-link.active, .shop-links .nav-link.show { color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.shop-menu { min-width: 16rem; border-color: var(--bs-border-color-translucent); }
.shop-menu { --bs-dropdown-link-active-bg: var(--bs-primary-bg-subtle); --bs-dropdown-link-active-color: var(--bs-primary-text-emphasis); }
.shop-menu .dropdown-item:hover, .shop-menu .dropdown-item:focus { background: var(--bs-tertiary-bg); }
.shop-nav .navbar { flex-wrap: wrap; }
.shop-dot { border: 2px solid var(--bs-body-bg); }
.shop-links { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; } .shop-links .nav-link { white-space: nowrap; }
.shop-body { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.shop-pick:hover { background: var(--bs-tertiary-bg); }
@media (max-width: 767.98px) { .shop-links { -webkit-mask-image: linear-gradient(90deg,#000 88%,transparent); mask-image: linear-gradient(90deg,#000 88%,transparent); padding-right: 2rem; } }
(function initSearchShortcut() {
var input = document.getElementById('shopSearch');
if (!input) return;
document.addEventListener('keydown', function (e) {
var t = e.target;
if (e.key !== '/' || /input|textarea|select/i.test(t.tagName)) return;
if (input.offsetParent === null) return;
e.preventDefault();
input.focus();
});
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.