

Photo: Shutterstock
Dropdown
Introduction
Natura11y provides three dropdown patterns for navigation: a standard button dropdown, a dropdown link split for top-level page access with sub-navigation, and a mega menu for rich multi-column panels.
Dropdown behavior
Include dropdown items within .nav and .nav--divider selectors, as well as within the .main-menu__nav selector inside the main menu component.
Natura11y provides two types of dropdown functionality:
- Click dropdowns (default): Activated by clicking the dropdown button
- Hover dropdowns: Activated by hovering on desktop or clicking on mobile/tablet
To create a dropdown, add the .dropdown class and data-toggle="dropdown" attribute to a <button>. Add a sibling <ul> with the .dropdown__menu class. For hover functionality, add data-hover="true" to the button.
HTML
<ul class="nav nav--divider border nav--horizontal">
<li>
<button class="dropdown" data-toggle="dropdown" aria-controls="click-menu-id" aria-expanded="false" type="button" > <span class="text"> Click Dropdown </span> </button>
<ul class="dropdown__menu" id="click-menu-id"> <li> <a href="#1">Link</a> </li> <li> <a href="#1">Link</a> </li> <li> <a href="#1">Link</a> </li> </ul>
</li> <li>
<button class="dropdown" data-toggle="dropdown" data-hover="true" aria-controls="hover-menu-id" aria-expanded="false" type="button" > <span class="text"> Hover Dropdown </span> </button>
<ul class="dropdown__menu" id="hover-menu-id"> <li> <a href="#1">Link</a> </li> <li> <a href="#1">Link</a> </li> <li> <a href="#1">Link</a> </li> </ul>
</li>
</ul>| Lines | Details |
|---|---|
| 5-15 | The first dropdown uses the default click behavior. The |
| 32-43 | The second dropdown includes the This enables hover functionality on desktop devices with fine pointer control, while maintaining click functionality on mobile devices. |
Dropdowns work as you might expect within vertical navigation:
HTML
<ul class="nav nav--divider"> ... </ul>Custom Indicator Icon
By default, the .dropdown button uses a CSS border caret as its direction indicator—no icon font required. To use an icon font character instead, add a data-indicator attribute with the glyph character or HTML entity (e.g. data-indicator="").
To replace the default CSS caret with a Natura11y icon, add data-indicator to the button with the icon’s Unicode value. This requires the Natura11y icon font.
HTML
<button class="dropdown" data-toggle="dropdown" data-indicator="" aria-controls="menu-id" aria-expanded="false" type="button" > <span class="text"> Dropdown </span> </button>Dropdown Link Split
The .dropdown-link-split selector combines a direct link to a top-level page with a dropdown button for accessing sub-pages. This pattern provides better accessibility and user experience by offering multiple interaction methods:
- Link access: Click or tap the link text to go directly to the main page
- Desktop dropdown: Hover over the entire component to reveal sub-pages
- Mobile dropdown: Tap the dropdown button to access sub-pages
- Keyboard navigation: Tab to the dropdown button independently from the link
To create this pattern, include both an <a> tag and a <button> with the data-toggle="dropdown" attribute within a .dropdown-link-split wrapper (Figure 4, line 4). Place the related dropdown or mega menu inside the same <li>.
This approach is particularly useful for main navigation where you want to provide direct access to category pages while also offering sub-navigation options.
HTML
<ul class="nav nav--horizontal">
<li> <div class="dropdown-link-split">
<a href="#1" class="text"> Link </a>
<button data-toggle="dropdown" aria-controls="docs-dropdown" aria-expanded="false" type="button"> </button>
</div>
<ul class="dropdown__menu" id="docs-dropdown"> <li> <a href="#1">Link</a> </li> <li> <a href="#1">Link</a> </li> </ul>
</li>
</ul>| Lines | Details |
|---|---|
| 4 | The It contains both the main link and the dropdown button, providing the dual functionality of the component. |
| 6-8 | The This provides the direct link functionality, allowing users to navigate directly to the top-level page. |
| 10-15 | The The |
The .dropdown-link-split functionality remains the same as standard dropdowns, supporting both keyboard navigation and screen readers.
Inside .nav--divider and .main-menu__nav on mobile, the component renders as a split row: the .text link spans the full width, and the toggle button becomes a square tap target beside it using var(--subtle-fill-1) as its background. At desktop breakpoints, the layout resets to the standard inline appearance.
This pattern also works with mega menus — simply replace the .dropdown__menu list with a .mega-menu--{bp} element for larger, multi-column dropdown content.















































