The Bootstrap 5 navbar is the most-used component in any web project. This page covers 5 practical navbar patterns — from a simple responsive nav to sticky and dropdown menus — each with working HTML you can copy directly.
Quick Setup
Before using any example, add Bootstrap 5 to your <head>:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
Key Classes Reference
| Class | What It Does |
|---|---|
.navbar | Required wrapper |
.navbar-expand-lg | Collapses on screens < 992px |
.navbar-brand | Styles your logo or site name |
.navbar-toggler | Hamburger button on mobile |
.sticky-top | Sticks to top on scroll |
.fixed-top | Always pinned, outside document flow |
data-bs-theme="dark" | Dark mode (Bootstrap 5.3+) |
.me-auto | Pushes items to the right |
1. Basic Bootstrap 5 Navbar
The simplest responsive navbar with brand and nav links. Collapses to a hamburger menu on mobile automatically.
2. Dark Bootstrap 5 Navbar
Use data-bs-theme='dark' for Bootstrap 5.3+ dark navbars with automatic link color handling.
3. Navbar with Dropdown Menu
Add multi-level dropdown menus using .dropdown inside .navbar-nav.
4. Navbar with Search Bar
Embed a search form inside the navbar using d-flex utility classes.
5. Sticky Navbar
Use sticky-top to keep the navbar visible on scroll without removing it from document flow.
Frequently Asked Questions
Need a Full Bootstrap 5 Admin Dashboard?
Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components — built by the same team behind BootstrapPlanet.
Browse Templates →Use code FIRST30 for 30% off your first purchase.