Etch component
Drawer Menu 3
Side menu drawer with sub-menus in nested drawers, from Nick Arce's Hydra pattern. Opens from a button with the id open-mac-drawer-menu-3.
Documentation
A side menu drawer whose sub-menus open in drawers of their own, from Nick Arce's Hydra pattern. Use it for menus with more than one level.
How to use it
- Give a button on the page the id
open-mac-drawer-menu-3. The drawer opens from the left when it's clicked. - Each sub-menu is a nested MAC Drawer 1 that opens from a button in the main list. The Product sub-menu, for example, has the Unique ID
mac-drawer-menu-3-productand opens from#mac-drawer-menu-3-product-trigger. - To add a sub-menu, duplicate a button and its drawer in Etch's component editor, then give both a new name in the button's id, the drawer's Unique ID and its Open Trigger Selector.
- A sub-menu's links are MAC Drawer Section 2 groups, and its back button,
.mac-drawer-menu-3__back, closes it.
Good to know
- A nested drawer moves itself to the end of the page, so its overlay covers the whole screen.
- Its ids are fixed, so use it once per page.
Reference
Read from the component's JSON, so it's always current.
Loading the reference