bootstrap_ref_comp_dropdowns
Bootstrap Dropdown Components
Section titled “Bootstrap Dropdown Components”Dropdowns
Section titled “Dropdowns”Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They are made interactive with the Bootstrap dropdown JavaScript plugin (or data attributes). In Bootstrap 5, use data-bs-toggle="dropdown" to activate them.
For a tutorial about Dropdowns, read our Bootstrap Dropdowns Tutorial.
ClassDescriptionExample (Conceptual - Refer to full Dropdowns tutorial for code)
.dropdownIndicates a dropdown menu container.Try it
.dropdown-menuBuilds the actual dropdown menu list.Try it
.dropdown-menu-endRight-aligns a dropdown menu relative to its trigger. (Replaces `.dropdown-menu-right`)Try it
.dropdown-menu-startLeft-aligns a dropdown menu relative to its trigger (default behavior, but can be explicit).Try it
.dropdown-headerAdds a header text inside the dropdown menu.Try it
.dropupIndicates a dropup menu, opening upwards.Try it
.dropendIndicates a dropdown menu that opens to the right of the trigger.Try it
.dropstartIndicates a dropdown menu that opens to the left of the trigger.Try it
.dropdown-item.disabled, a.dropdown-item.disabledDisables an item in the dropdown menu. Use `aria-disabled="true"` for accessibility.Try it
.dropdown-dividerSeparates groups of related menu items with a horizontal line. (Replaces `.divider`)Try it
.dropdown-item-textFor adding plain text to a dropdown, not interactive.Try itNote: Bootstrap 5 prefers data-bs-* attributes, so data-toggle="dropdown" becomes data-bs-toggle="dropdown".