Dropdowns
Dropdowns give us the ability to toggle an overlaying list or menu of links. They let a user select a single item from this list.
Control Styles
There are two different base options for your control. You can either use a button or a button link. The difference between the two is the prominence the component has within the UI.
Any Button style can be used, but the .btn-default
class is the primary dropdown button controls.
Dropdown Indicator
Add a .caret
as the indicator for a dropdown, not a chevron.
Do:
Use the icon .fa-caret-down
.
Don't:
Use the icon .fa-chevron-down
.
Variants
Menu Sizes
Name | Example | Notes |
---|---|---|
Small Menu |
|
Add |
Large Menu |
|
Add |
Full Width |
|
No extra class needs to be added to make the menu full width to match your button block. as long as you have the |
Mega Menu |
|
The dropdown mega menu is used when there is an unknown amount of list items, so there is a need for multiple columns in the dropdown. First the class |
HTML
|
Dropdown Direction
To align the dropdown menu's contents to the right side of the dropdown button, add .dropdown-menu-right
to the .dropdown-menu
.
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
. . .
</ul>
</div>