Dropdowns
Basic Dropdown
html
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Options
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else</a></li>
</ul>
</div>
- The wrapper has
.dropdown(needed to position the menu) - The button has
.dropdown-toggleanddata-bs-toggle="dropdown" - The list has
.dropdown-menu, and each link has.dropdown-item
Result
Clicking Options opens a small white menu with three actions below the button.
Headers, Dividers and States
html
<ul class="dropdown-menu">
<li><h6 class="dropdown-header">Account</h6></li>
<li><a class="dropdown-item active" href="#">Profile</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item disabled" href="#">Archived</a></li>
<li><a class="dropdown-item text-danger" href="#">Log out</a></li>
</ul>
Directions
| Wrapper Class | Menu Opens |
|---|---|
dropdown | Down (default) |
dropup | Up |
dropend | To the right |
dropstart | To the left |
Alignment
html
<ul class="dropdown-menu dropdown-menu-end">...</ul>
dropdown-menu-end aligns the menu with the right edge of the button. This is useful for menus placed at the right side of the page, so they do not get cut off.
Split Button
html
<div class="btn-group">
<button type="button" class="btn btn-danger">Delete</button>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">More</span>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Delete all</a></li>
<li><a class="dropdown-item" href="#">Move to trash</a></li>
</ul>
</div>
Dark Dropdown
html
<ul class="dropdown-menu" data-bs-theme="dark">...</ul>
Common Mistakes
- Forgetting the JS bundle, so nothing opens
- Using the
bootstrap.jsfile without Popper - Placing the menu outside the
.dropdownwrapper
Conclusion
Dropdowns hide extra options until needed, keeping your interface clean. They are used in navbars, tables and toolbars.
Quick Summary: dropdown wrapper, dropdown-toggle button with data-bs-toggle, and dropdown-menu with dropdown-item links.

