
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
bs-enhanced-dropdowns
Advanced tools
This project provides an enhanced navigation menu system for Bootstrap 5, featuring split dropdown buttons, multi-level submenus, improved keyboard accessibility, and intelligent handling of link behavior based on the `href` attribute.
Live Demo · Split dropdown buttons, multi-level submenus, and improved keyboard accessibility for Bootstrap 5.
| Feature | Description |
|---|---|
| Split Dropdown Buttons | Link navigates, caret toggles dropdown |
| Multi-level Submenus | Up to 3 levels deep |
| Auto Multi-Column | 1-5 columns based on item count (desktop) |
| Smart Hover | Hover-to-open on desktop, click always works* |
| Keyboard Navigation | Arrow keys, Enter, Space, Escape, Tab |
| ARIA Accessibility | Full screen reader support |
| Mobile-Friendly | Responsive for all viewports |
| RTL Support | Full right-to-left language support |
*If any dropdown in a navbar has nested submenus, all dropdowns in that navbar become click-only to avoid frustrating hover tunnel navigation.
1. Include Bootstrap 5:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
2. Include Enhanced Dropdowns:
<link href="css/enhanced-dropdowns.css" rel="stylesheet">
<script src="js/enhanced-dropdowns.js"></script>
3. Initialize:
<script>
document.addEventListener('DOMContentLoaded', () => {
new BootstrapEnhancedDropdowns();
});
</script>
Wrap navigation in <ul class="navbar-nav" role="menubar">.
<li class="nav-item dropdown" role="none">
<div class="bs-dropdown-wrapper">
<a class="nav-link" href="/features" role="menuitem">Features</a>
<button class="bs-dropdown-caret" type="button" aria-expanded="false">
<span class="visually-hidden">Toggle submenu</span>
</button>
</div>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/overview" role="menuitem">Overview</a></li>
</ul>
</li>
<li class="nav-item dropdown" role="none">
<a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">
About
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/team" role="menuitem">Team</a></li>
</ul>
</li>
| Class | Purpose |
|---|---|
.bs-dropdown-wrapper | Wrapper for top-level split buttons |
.bs-dropdown-item-wrapper | Wrapper for nested split buttons |
.bs-dropdown-caret | Clickable caret button |
.bs-dropdown-submenu | Container for nested dropdown |
See index.html and demo.html for complete examples.
| Key | Action |
|---|---|
Tab | Move between top-level items |
↓ / ↑ | Navigate within dropdown |
Enter / Space | Activate item |
Escape | Close dropdown |
← | Close submenu, return to parent |
| Criterion | Level | Description |
|---|---|---|
| 2.1.1 Keyboard | A | Full navigation via arrows, Enter, Space, Escape, Tab |
| 2.1.2 No Keyboard Trap | A | Tab and Escape always allow exiting menus |
| 2.4.7 Focus Visible | AA | Clear focus indicators on all interactive elements |
| 1.4.13 Content on Hover or Focus | AA | Hover menus persist, dismissible via Escape |
| 4.1.2 Name, Role, Value | A | ARIA roles and states (aria-expanded, aria-controls) |
| 2.5.5 Target Size | AAA | Caret toggles meet 44×44px minimum |
| Variable | Purpose |
|---|---|
--bs-dropdown-caret-width | Caret button width |
--bs-dropdown-caret-padding-x | Caret horizontal padding |
--bs-dropdown-indent-step | Submenu indentation |
Desktop (≥992px) applies columns automatically:
| Items | Columns | Full Width |
|---|---|---|
| 1-7 | 1 | No |
| 8-14 | 2 | No |
| 15-20 | 3 | Yes |
| 21-27 | 4 | Yes |
| 28+ | 5 | Yes |
FAQs
This project provides an enhanced navigation menu system for Bootstrap 5, featuring split dropdown buttons, multi-level submenus, improved keyboard accessibility, and intelligent handling of link behavior based on the `href` attribute.
We found that bs-enhanced-dropdowns demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.