Main Header Component
Reminder!
AdminLTE uses all of Bootstrap 5 components. It's a good start to review the Bootstrap documentation to get an idea of the various components that this documentation does not cover.
Tips!
If you go through the example pages and would like to copy a component, right-click on the component and choose “inspect element” to get to the HTML quicker than scanning the HTML page.
<!-- Navbar -->
<nav class="app-header navbar navbar-expand bg-body">
<!--begin::Container-->
<div class="container-fluid">
<!-- Start navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-lte-toggle="sidebar" href="#" role="button" aria-label="Toggle sidebar">
<i class="bi bi-list" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item d-none d-md-block">
<a href="#" class="nav-link">Home</a>
</li>
<li class="nav-item d-none d-md-block">
<a href="#" class="nav-link">Contact</a>
</li>
</ul>
<!-- End navbar links -->
<!-- Navbar search: a quiet pill, the icon is the submit button (xl and up) -->
<form class="navbar-search d-none d-xl-block ms-3" role="search" action="search-results.html">
<label for="navbar-search-input" class="visually-hidden">Search</label>
<div class="navbar-search-field">
<input type="search" id="navbar-search-input" name="q" class="form-control" placeholder="Search…" autocomplete="off" />
<button class="navbar-search-submit" type="submit" aria-label="Submit search">
<i class="bi bi-search" aria-hidden="true"></i>
</button>
</div>
</form>
<ul class="navbar-nav ms-auto">
<!-- Search on small screens: link to the search page -->
<li class="nav-item d-xl-none">
<a class="nav-link" href="search-results.html" aria-label="Search">
<i class="bi bi-search" aria-hidden="true"></i>
</a>
</li>
<!-- Messages Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-bs-toggle="dropdown" href="#" aria-label="Messages: 3 unread">
<i class="bi bi-chat-text" aria-hidden="true"></i>
<span class="navbar-badge badge text-bg-danger">3</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="d-flex">
<div class="flex-shrink-0">
<img
src="../../../dist/assets/img/user1-128x128.jpg"
alt=""
class="img-size-50 rounded-circle me-3"
/>
</div>
<div class="flex-grow-1">
<p class="dropdown-item-title">
Brad Diesel
<span class="float-end fs-7 text-danger">
<i class="bi bi-star-fill"></i>
</span>
</p>
<p class="fs-7">Call me whenever you can...</p>
<p class="fs-7 text-secondary">
<i class="bi bi-clock-fill me-1"></i> 4 Hours Ago
</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="d-flex">
<div class="flex-shrink-0">
<img
src="../../../dist/assets/img/user8-128x128.jpg"
alt=""
class="img-size-50 rounded-circle me-3"
/>
</div>
<div class="flex-grow-1">
<p class="dropdown-item-title">
John Pierce
<span class="float-end fs-7 text-secondary">
<i class="bi bi-star-fill"></i>
</span>
</p>
<p class="fs-7">I got your message bro</p>
<p class="fs-7 text-secondary">
<i class="bi bi-clock-fill me-1"></i> 4 Hours Ago
</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<!-- Message Start -->
<div class="d-flex">
<div class="flex-shrink-0">
<img
src="../../../dist/assets/img/user3-128x128.jpg"
alt=""
class="img-size-50 rounded-circle me-3"
/>
</div>
<div class="flex-grow-1">
<p class="dropdown-item-title">
Nora Silvester
<span class="float-end fs-7 text-warning">
<i class="bi bi-star-fill"></i>
</span>
</p>
<p class="fs-7">The subject goes here</p>
<p class="fs-7 text-secondary">
<i class="bi bi-clock-fill me-1"></i> 4 Hours Ago
</p>
</div>
</div>
<!-- Message End -->
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
</div>
</li>
<!-- Notifications Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-bs-toggle="dropdown" href="#" aria-label="Notifications: 15 unread">
<i class="bi bi-bell-fill" aria-hidden="true"></i>
<span class="navbar-badge badge text-bg-warning">15</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
<span class="dropdown-item dropdown-header">15 Notifications</span>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="bi bi-envelope me-2"></i> 4 new messages
<span class="float-end text-secondary fs-7">3 mins</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="bi bi-people-fill me-2"></i> 8 friend requests
<span class="float-end text-secondary fs-7">12 hours</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="bi bi-file-earmark-fill me-2"></i> 3 new reports
<span class="float-end text-secondary fs-7">2 days</span>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">
See All Notifications
</a>
</div>
</li>
<li class="nav-item dropdown user-menu">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
<img
src="../../../dist/assets/img/user2-160x160.jpg"
class="user-image rounded-circle shadow"
alt="Alexander Pierce"
/>
<span class="d-none d-xl-inline">Alexander Pierce</span>
</a>
<ul class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
<!-- User image -->
<li class="user-header text-bg-primary">
<img
src="../../../dist/assets/img/user2-160x160.jpg"
class="rounded-circle shadow"
alt="Alexander Pierce"
/>
<p>
Alexander Pierce - Web Developer
<small>Member since Nov. 2023</small>
</p>
</li>
<!-- Menu Body -->
<li class="user-body">
<!--begin::Row-->
<div class="row">
<div class="col-4 text-center">
<a href="#">Followers</a>
</div>
<div class="col-4 text-center">
<a href="#">Sales</a>
</div>
<div class="col-4 text-center">
<a href="#">Friends</a>
</div>
</div>
<!--end::Row-->
</li>
<!-- Menu Footer-->
<li class="user-footer">
<a href="#" class="btn btn-outline-secondary">Profile</a>
<!-- Sign out with a POST and your CSRF token, never a GET link -->
<form method="post" action="/logout" class="float-end">
<button type="submit" class="btn btn-outline-danger">Sign out</button>
</form>
</li>
</ul>
</li>
</ul>
</div>
<!--end::Container-->
</nav>
<!-- /.navbar -->
Give every icon-only toggle an aria-label, and put the unread
count in it (“Notifications: 15 unread”), because without a label a screen
reader announces only the badge’s bare number. Mark decorative icons with
aria-hidden="true".
Inside a .navbar, Bootstrap positions dropdown menus without
Popper, aligned to their own toggle. Below the sm breakpoint
AdminLTE instead stretches each header dropdown across the header with a small
margin on both sides, so a wide menu under an icon in the middle of the header
stays on screen.
Arrow keys move between .dropdown-item elements. Entries without
that class, such as the links and buttons in the user menu’s body and footer,
are reached with Tab.