BBS5 Dropdowns
Learn how to create dropdown menus.
BS5 Dropdowns
Dropdowns are toggleable, contextual menus for displaying lists of links.
To create a dropdown, wrap the toggle (button/link) and the menu (list) within a .dropdown class.
Add the .dropdown-toggle class to the button, and data-bs-toggle="dropdown".
Add the .dropdown-menu class to the list of items (<ul>), and .dropdown-item to each list item.
Dropdown Divider
The .dropdown-divider class is used to separate links inside the dropdown menu with a thin horizontal border.
Examples
Basic Dropdown
html/cssA standard button dropdown.
<div class="dropdown">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
Dropdown button
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Link 1</a></li>
<li><a class="dropdown-item" href="#">Link 2</a></li>
<li><a class="dropdown-item" href="#">Link 3</a></li>
</ul>
</div>Dropdown Divider
html/css