Overview and examples
Use any button to trigger a dropdown menu by placing it within a .btn-group
and providing the proper menu markup.
class="btn-group">- class="btn dropdown-toggle"data-toggle="dropdown"href="#">
- Action
- class="caret">
class="dropdown-menu">
Works with all button sizes
Button dropdowns work at any size: .btn-large
, .btn-small
, or .btn-mini
.
Requires JavaScript
Button dropdowns require the Bootstrap dropdown plugin to function.
In some cases—like mobile—dropdown menus will extend outside the viewport. You need to resolve the alignment manually or with custom JavaScript.
Split button dropdowns
Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.
class="btn-group">- class="caret">
class="dropdown-menu">
Sizes
Utilize the extra button classes .btn-mini
, .btn-small
, or .btn-large
for sizing.
class="btn-group">- class="caret">
class="dropdown-menu">
Dropup menus
Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of .dropdown-menu
. It will flip the direction of the .caret
and reposition the menu itself to move from the bottom up instead of top down.
class="btn-group dropup">- class="caret">
class="dropdown-menu">
Leave a Reply