Display a list of choices or commands in a dropdown menu.
Waterhole uses the inclusive
popup
and
menu
elements to power menu buttons. Wrap the trigger button and menu in a
<ui-popup> element to hook it up as an accessible popup. Use a <ui-menu>
element for the menu itself to enable keyboard navigation.
Menus should be styled with the .menu class. To prevent
FOUC, add the
hidden attribute to the menu so it is hidden even before the JavaScript has
loaded.
Use the .menu-item class for menu items, which can be buttons, links, or
labels. Menu items support icons.
Menu items will be styled as "selected" if they have the .is-active class, or
[aria-current="page"] or [aria-checked="true"] attributes. The
.menu-item__check class can be used to display an icon which will only become
visible if the containing menu item is selected.