Bootstrap 5 Social Navbar with Icons and Dropdown
A responsive navbar for social sites with icon links, a Media dropdown for Facebook, Instagram and YouTube, and a sign-up button. It collapses into a toggle menu on small screens.
<section class="wdw-stage wdw-aurora">
<div class="container nav-wrap" style="max-width:960px">
<nav class="navbar navbar-expand-lg wdw-card social-nav px-3 px-lg-4" aria-label="Main">
<a class="navbar-brand d-flex align-items-center gap-2 fw-bolder wdw-heading" href="#">
<span class="wdw-icon brand-mark"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="8" r="3.5"/><path d="M2.5 20c.6-3.4 3.2-5.5 6.5-5.5s5.9 2.1 6.5 5.5M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.8c1.9.8 3.1 2.5 3.5 5.2"/></svg></span>
Circle
</a>
<button class="navbar-toggler border-0 shadow-none" type="button" data-bs-toggle="collapse" data-bs-target="#socialNav" aria-controls="socialNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="socialNav">
<ul class="navbar-nav ms-auto align-items-lg-center gap-lg-1 py-3 py-lg-0">
<li class="nav-item"><a class="nav-link active" href="#" aria-current="page"><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"><path d="M20.8 5.6a5.2 5.2 0 0 0-7.4 0L12 7l-1.4-1.4a5.2 5.2 0 0 0-7.4 7.4L12 21.8l8.8-8.8a5.2 5.2 0 0 0 0-7.4z"/></svg>Follow</a></li>
<li class="nav-item"><a class="nav-link" href="#"><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"><path d="M7 11v9H4v-9h3zm0 0 4-8c1.7 0 2.5 1.3 2 3l-.7 3H19a2 2 0 0 1 2 2.4l-1.2 6A2 2 0 0 1 17.8 20H7"/></svg>Collaboration</a></li>
<li class="nav-item dropdown">
<button class="nav-link dropdown-toggle" id="mediaToggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m10 9 5 3-5 3z"/></svg>Media</button>
<ul class="dropdown-menu dropdown-menu-lg-end p-2 media-menu" aria-labelledby="mediaToggle">
<li><a class="dropdown-item d-flex align-items-center gap-3 rounded-3 py-2 px-2" href="#"><span class="wdw-icon media-tile"><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="M14 8h3V4h-3a4 4 0 0 0-4 4v3H7v4h3v6h4v-6h3l1-4h-4V8z"/></svg></span><span><span class="d-block fw-semibold text-body-emphasis">Facebook</span><span class="d-block small wdw-muted text-wrap">Community groups and events</span></span></a></li>
<li><a class="dropdown-item d-flex align-items-center gap-3 rounded-3 py-2 px-2" href="#"><span class="wdw-icon media-tile"><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="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><path d="M17.5 6.5h.01"/></svg></span><span><span class="d-block fw-semibold text-body-emphasis">Instagram</span><span class="d-block small wdw-muted text-wrap">Stories, reels and photo drops</span></span></a></li>
<li><a class="dropdown-item d-flex align-items-center gap-3 rounded-3 py-2 px-2" href="#"><span class="wdw-icon media-tile"><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="2.5" y="5" width="19" height="14" rx="4"/><path d="m10 9.5 5 2.5-5 2.5z"/></svg></span><span><span class="d-block fw-semibold text-body-emphasis">YouTube</span><span class="d-block small wdw-muted text-wrap">Tutorials and live sessions</span></span></a></li>
</ul>
</li>
<li class="nav-item ms-lg-2 mt-2 mt-lg-0"><a class="btn btn-primary rounded-pill px-4" href="#">Sign up</a></li>
</ul>
</div>
</nav>
</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 */
.social-nav { --bs-navbar-padding-y: .65rem; }
@media (min-width: 992px) { .nav-wrap { padding-bottom: 13rem; } }
@media (max-width: 991.98px) { .nav-wrap { padding-bottom: 1rem; } }
.social-nav .brand-mark { width: 2.25rem; height: 2.25rem; border-radius: .7rem; }
.social-nav .nav-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem .9rem; border: 0; background: none; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--bs-secondary-color); transition: background .2s, color .2s; text-decoration: none; }
.social-nav .nav-link:hover, .social-nav .nav-link:focus-visible, .social-nav .nav-link.show { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); }
.social-nav .nav-link:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.social-nav .nav-link.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.social-nav .dropdown-toggle::after { margin-left: .15rem; }
.media-menu { min-width: 19rem; margin-top: .75rem !important; }
.media-menu .dropdown-item { white-space: normal; }
.media-tile { width: 2.5rem; height: 2.5rem; border-radius: .75rem; }
@media (max-width: 991.98px) { .social-nav .nav-link { border-radius: .75rem; } .media-menu { box-shadow: none; border: 0; padding: .25rem 0 !important; margin-top: 0 !important; } }
(function () {
// Demo hook: keep the "#" placeholder links from jumping, and mark the clicked one active.
function initActiveLink() {
var links = document.querySelectorAll('.social-nav .nav-link:not(.dropdown-toggle)');
links.forEach(function (link) {
link.addEventListener('click', function (e) {
if (link.getAttribute('href') === '#') e.preventDefault();
links.forEach(function (l) { l.classList.remove('active'); l.removeAttribute('aria-current'); });
link.classList.add('active');
link.setAttribute('aria-current', 'page');
});
});
}
// Open the Media menu on load so the component is visible; any click closes it as usual.
function initDemoOpen() {
var toggle = document.getElementById('mediaToggle');
var collapse = document.getElementById('socialNav');
if (!toggle || !collapse) return;
if (window.matchMedia('(max-width: 991.98px)').matches) {
bootstrap.Collapse.getOrCreateInstance(collapse, { toggle: false }).show();
}
bootstrap.Dropdown.getOrCreateInstance(toggle).show();
}
initActiveLink();
initDemoOpen();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.