Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultNavigationTwo-Level Drawer Menu
Torn Edge RevealBrowse all 182Velocity Clip Gallery
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Two-Level Drawer Menu

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap

Setup

npm i gsap

More like this

  • Menu
  • Drawer
  • Wipe

Features.

  • Opening dims the page and wipes a light panel in from the left behind a rounded clip
  • Categories slide in one after another, then the image cards follow
  • Hovering a category with sub-links wipes a second panel in beside the first
  • Moving to another category cross-fades the list in place instead of closing and reopening the panel
  • A category without sub-links folds the second panel away; a 200ms grace lets the pointer cross the gap between panels
  • Hover pops an orange dot and steps the label aside, on categories and sub-links
  • The Menu label rolls to Close while the burger folds into an X
  • On phones the second panel slides over the first on tap, with a Back button
  • Escape, the dimmed page or the toggle closes, and focus goes back to the toggle; the overlay is inert while closed
  • Opening moves focus to the first category, Tab stays inside the menu, and the page behind is locked
  • Panel 2 can't take focus while it's shut, and each panel scrolls on short screens
  • Re-opening mid-close carries on from where it is
  • Respects prefers-reduced-motion: every move swaps instead of animating
  • GSAP only, plain CSS for the look

How to get it right.

Give each category an id

A category opens the sub-list whose data-tpm-sublist matches its data-tpm-primary. Leave data-tpm-primary empty for a link that has no sub-list (it folds panel 2 away on hover).

Keep sub-lists short

Panel 2 is 17.5em wide and shows one list at a time. Four to six links of a few words each read best; longer lists make the panel scroll.

Keep the panels apart from the page

The panels are their own light island (--tpm-panel, --tpm-ink). The contrast between the dimmed page and the panel is what makes the wipe read.

Click works too

Categories are buttons: clicking one opens its sub-list as well, so keyboard users and touch screens get the same second level. A keyboard press, or a tap on a phone, also moves focus into the list.

Variations.

  • Default — 0.8s open, 0.6s close, 26.25em first panel
  • Snappy — data-au-duration="0.5"
  • Wide — data-au-width="30" for longer category names
  • Single level — leave every data-tpm-primary empty and remove the sub-lists; panel 2 never opens
  • Your colours — override --tpm-panel, --tpm-ink, --tpm-muted, --tpm-scrim and --tpm-accent on .tpm_menu

Where it fits.

  • Shops — categories with sub-categories and a couple of featured cards, the setup this demo shows
  • Agencies and studios — services and work by sector, with case-study cards
  • Docs and help centres — sections on the left, articles on the right

Frequently asked.

The logo sits under the overlay on purpose, so panel 1 covers it; the toggle sits above, so you can always close.

Yes. Set --tpm-fg (logo and toggle) to a dark colour (#252422) and choose a --tpm-panel that stands apart from your page.

Above 767px both panels sit side by side. At 768px the two panels and their gaps take about 45em, so keep data-au-width modest if you expect small tablets. At 900px wide and under, panel 2 starts below the toggle, so the toggle stays readable. With a wider data-au-width it can still reach under the toggle above 900px.

Links are ordinary anchors and navigate as usual. In a single-page app call window.au.TwoPanelMenu.refresh() after the route changes to reset it closed and release the page lock.

Yes: overflow: hidden on <html> while open (plus scrollbar-gutter: stable if the page has a scrollbar), released when the close finishes and in destroy(). A smooth-scroll library that scrolls from script ignores that, so stop yours while the root has is-open, or add data-lenis-prevent to the overlay if it's Lenis.

Panel 1 holds the categories and two image cards by default. Add <a class="tpm_more" href="..." data-tpm-extra> as the last child of .tpm_nav, a <nav class="tpm_foot"> of .tpm_foot-link links after .tpm_cards, and <a class="tpm_more tpm_more--sub" href="..."> after .tpm_stack in panel 2. Keep data-tpm-extra on the first two so they join the reveal. The styles are still in code.css.

Related components.

NewPro

Ink Spread Menu

Click

Pro

Folding Burger Nav

Scroll

Pro

Full-Screen Wipe Menu

Click