Dropdowns

Vue Bootstrap 5 Dropdown component

Toggle contextual overlays for displaying lists of links and more with the MDB dropdown plugin.

Note: Read the API tab to find all available options and advanced customization


Basic examples

Wrap the MDBDropdownToggle (your button or link) and the MDBDropdownMenu within MDBDropdown element. Bind any truthy or falsy ref value to MDBDropdownMenu and toggle dropdown with a MDBDropdownToggle component. MDBDropdownMenu use semantic <ul> elements where appropriate, but custom markup is supported.

Regular button

MDBDropdownToggle is a regular button with primary color by default.


Colors

You can do this with any button variant:


Split button

Similarly, create split button dropdowns by placing regular MDBBtn component and additional MDBDropdownToggle with split property for proper spacing around the dropdown caret.

We use this extra class to reduce the horizontal padding on either side of the caret by 25% and remove the margin-left that’s added for regular button dropdowns. Those extra changes keep the caret centered in the split button and provide a more appropriately sized hit area next to the main button.


Sizing

MDBDropdownToggle work with all button sizes, including default and split dropdown buttons.


Directions

Dropup

Trigger dropdown menus above elements by adding dropup property to the MDBDropdown component.

Dropright

Trigger dropdown menus at the right of the elements by adding .dropend to the parent element.

Dropleft

Trigger dropdown menus at the left of the elements by adding dropstart property to the MDBDropdown component.


Menu items

Historically dropdown menu contents had to be links. Now you can optionally use <button> elements in your dropdowns instead of just <a>.

You can also create non-interactive dropdown items with text property. Feel free to style further with custom CSS or text utilities.

Active

Add active property to items in the dropdown to style them as active.

Disabled

Add disabled property to items in the dropdown to style them as disabled.


Menu alignment

By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add align="end" property to a MDBDropdown to right align the dropdown menu.

Responsive alignment

If you want to make dropdown alignment responsive, use the responsive variation classes.

To align right the dropdown menu with the given breakpoint or larger, add align="sm|md|lg|xl|xxl-end".

To align left the dropdown menu with the given breakpoint or larger, add align="sm|md|lg|xl|xxl-start".

To align dropdown menu right by default, but left when the given breakpoint or larger, add :align="['end', 'sm|md|lg|xl|xxl-start']".

Note that you don’t need to add a data-mdb-display="static" attribute to dropdown buttons in navbars, since Popper isn’t used in navbars.

Alignment options

Taking most of the options shown above, here’s a small kitchen sink demo of various dropdown alignment options in one place.

Note: For the secondary buttons it may be required to remove the shadow with .shadow-0 class.


Menu content

Headers

Add a header property to label sections of actions in any dropdown menu.

Dividers

Separate groups of related menu items with a divider property.

Text

Place any freeform text within a dropdown menu with text and use spacing utilities. Note that you’ll likely need additional sizing styles to constrain the menu width.

Forms

Put a form within a dropdown menu, or make it into a dropdown menu, and use margin or padding utilities to give it the negative space you require.


Remove animation

To remove the fade animation on click, add :animation="false" attribute to the MDBDRopdownToggle.


Dropdown options

To change the offset of the dropdown menu add offset="skiddingValue, distanceValue" property. To change the location of the dropdown menu add target property with value of selector to expected reference for dropdown.


Dark variant

Add dark property onto an existing MDBDropdownMenu to match a dark navbar.