Offcanvas, Dropdowns, Pagination and Breadcrumbs
Navigation patterns help people find their way, especially on phones where space is tight. Dropdowns tuck extra links away, an offcanvas panel slides in for menus or filters, breadcrumbs show where you are (Home › Electronics › Phones), and pagination splits long lists into pages.
Dropdown
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<div class="dropdown">
<button class="btn btn-outline-dark dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">Sort by</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Price: low to high</a></li>
<li><a class="dropdown-item" href="#">Price: high to low</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Newest first</a></li>
</ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>▶ Try it yourselfOffcanvas - a side panel
An offcanvas slides in from the side - perfect for a phone menu or a filter panel.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<button class="btn btn-primary" data-bs-toggle="offcanvas" data-bs-target="#filters">Filters</button>
<div class="offcanvas offcanvas-start" tabindex="-1" id="filters" aria-labelledby="filtersTitle">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="filtersTitle">Filters</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="form-check"><input class="form-check-input" type="checkbox" id="f1"><label class="form-check-label" for="f1">Under ₹500</label></div>
<div class="form-check"><input class="form-check-input" type="checkbox" id="f2"><label class="form-check-label" for="f2">4★ and above</label></div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>▶ Try it yourselfBreadcrumbs and pagination
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Electronics</a></li>
<li class="breadcrumb-item active" aria-current="page">Earbuds</li>
</ol>
</nav>
<nav aria-label="Product pages">
<ul class="pagination">
<li class="page-item disabled"><a class="page-link">Previous</a></li>
<li class="page-item active" aria-current="page"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</body>
</html>▶ Try it yourselfMark the current page with
aria-current="page" so screen readers say which page you are on.Key points
- Dropdowns and offcanvas panels need Bootstrap's JavaScript.
- Breadcrumbs show location; pagination splits long lists.
- Mark the current page with aria-current="page".
📝 Test yourself
1. Which component slides in from the side of the screen?
2. What does a breadcrumb show?
3. Fill in the class for one menu entry in a dropdown:
<a class="dropdown-" href="#">Newest</a>
