Skip to content

Menu Dropdown Button Variants

Bootstrap 6 Menu dropdowns on buttons: split button with selectable options, drop up, drop end, drop start, headers, icons and dividers.

Also known as: dropdown button variants, split button dropdown, dropup dropdown, dropdown menu with icons, dropdown with headers and dividers

Bootstrap 6 Dropdowns Responsive #button #dropdown #menu #split-button

Menu Dropdown Button Variants live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A set of Bootstrap 6 Menu dropdowns on buttons, laid out as a reference board: a menu with headers, icons and dividers, a split button with selectable merge options, and three direction variants (drop up, drop end and drop start). Use it as a starting point for action menus in toolbars, tables and admin screens.

How it works

Every toggle is a button with data-bs-toggle="menu", and its .menu sits right after it as a sibling. There is no .dropdown wrapper in Bootstrap 6. The plugin positions each menu with the bundled Floating UI. Directions come from data-bs-placement on the toggle: top for the Share menu, end-start for Move to and start-start for Sort by. Floating UI flips a menu when there is no room, so on phones the side menus open above or below instead.

The featured "Project actions" menu shows the content classes: h6.menu-header section titles, hr.menu-divider, .menu-item-icon icons, a disabled item and a red .menu-item.theme-danger item. The split button is a .btn-group with a .menu-toggle-split button. Its options use .menu-item-content with .menu-item-description, and a .menu-item-check icon that only shows on the .selected item.

script.js moves .selected and aria-current to the clicked option, copies its data-mbv-label onto .mbv-split-main and shows the chosen sort order in .mbv-sort-value. Every choice is also announced in the .mbv-status live region. For the preview, the featured menu is opened on load with Menu.getOrCreateInstance(...).show(), and .mbv-instant turns off its fade-in.

Customization

  • Remove data-mbv-open-on-load from .mbv-root so all menus start closed (recommended in production).
  • --mbv-bg, --mbv-tile and --mbv-line on .mbv-root: change the board, tile and border colors.
  • --bs-menu-bg, --bs-menu-item-hover-bg and --bs-menu-check-color on .mbv-menu: restyle every menu surface, hover state and check mark.
  • data-bs-placement on any toggle: try bottom-end, top-start or responsive values such as bottom-start md:end-start.
  • data-mbv-label on each .mbv-option: sets the text the split button shows after a choice.
  • Swap theme-success or theme-primary on the buttons for another theme role to recolor them.

Use cases

  • Toolbars and action bars: a split button runs a default action and offers more options in a menu
  • Admin interfaces: menu headers, icons and dividers group related actions
  • Pages near the edges: drop up, drop start and drop end open the menu where there is room
  • Settings and sorting controls: a split button with selectable options remembers the choice

Accessibility

Toggles are real buttons with aria-expanded, which the Menu plugin keeps up to date. The icon-only split toggle has a visually hidden label. The plugin handles keyboard use: Enter or Space opens a menu, the arrow keys move between items, and Escape closes it and returns focus to the toggle. Selected options carry aria-current="true", icons are aria-hidden, and the result line is a polite live region. Toggles and items have a high-contrast orange focus outline.

Bootstrap 6 notes

Bootstrap 5's .dropdown, .dropdown-menu, .dropdown-item and data-bs-toggle="dropdown" become .menu, .menu-item and data-bs-toggle="menu". dropup, dropend and dropstart are now data-bs-placement values, and dropdown-toggle-split is menu-toggle-split. Buttons use btn-solid, btn-outline and btn-subtle with theme-* roles. Built on Bootstrap 6.0.0-alpha.1, so alpha APIs can still change. Icons come from Bootstrap Icons.

Menu Dropdown Button Variants at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Dropdowns
License
Free for personal and commercial use

Questions about this template

Can I use the Menu Dropdown Button Variants code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Menu Dropdown Button Variants – free Bootstrap 6 dropdown template
Menu Dropdown Button Variants · free Bootstrap 6 dropdown template

More Dropdowns

Hover and Focus Dropdown – free Pure CSS dropdown template

Hover and Focus Dropdown

Dark navbar with pure CSS dropdown menus that open on hover and keyboard focus, plus a small vanilla JS layer for Escape, arrow keys and touch taps.

Nested Multi-Level Dropdown – free Pure CSS dropdown template

Nested Multi-Level Dropdown

Dark navigation bar with a three-level dropdown: flyout submenus on desktop, an inline accordion on mobile, plus hover, click and full keyboard support.

Notifications Dropdown with User Photos – free Bootstrap 5 dropdown template

Notifications Dropdown with User Photos

Bootstrap 5 navbar bell dropdown listing notifications with user photos, activity icons, times, unread dots and a mark-all-as-read action.

User Account Dropdown – free Bootstrap 5 dropdown template

User Account Dropdown

Bootstrap 5 avatar dropdown with profile header, plan badge, online/away/busy status picker and account menu links for app headers.

Dropdown Menu with Icons – free Tailwind CSS dropdown template

Dropdown Menu with Icons

Accessible Tailwind CSS menu button with icons, grouped items, dividers, shortcut hints, typeahead and full arrow-key navigation.