Button Dropdown Menus
Use a button dropdown when one control needs to reveal a short list of related actions. The examples below use Bootstrap-style .btn-group, .dropdown-toggle, and .dropdown-menu markup.
Note: These dropdowns require the Bootstrap dropdown plugin to open and close.
Standard button dropdown example
Place the trigger button and menu inside a .btn-group. The button can use the standard style or a contextual button class.
Basic markup
<div class="btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<!-- dropdown menu links -->
</ul>
</div>
Button dropdown sizes
Button dropdowns can use the same size classes as other buttons: .btn-large, .btn-small, and .btn-mini.
Split button dropdowns
A split button keeps the primary action separate from the menu toggle. Select the left button for the main action, or use the caret button to open related options.
Split button markup
<div class="btn-group">
<button class="btn">Action</button>
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<!-- dropdown menu links -->
</ul>
</div>
Apply .btn-large, .btn-small, or .btn-mini to both buttons in the group when a split button needs a different size.
Dropup menus
Add .dropup to the immediate .btn-group parent to open the menu upward instead of downward. This also changes the caret direction.
<div class="btn-group dropup">
<button class="btn">Dropup</button>
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<!-- dropdown menu links -->
</ul>
</div>
Implementation notes
- Include the Bootstrap dropdown plugin for interactive behavior.
- Use meaningful labels for menu actions rather than generic labels when building a live interface.
- On smaller screens, a dropdown menu may extend outside the viewport. Menu alignment may need to be handled manually or with custom JavaScript.