Skip to the content

Anchored expandable menu

Navigation anchored at the top of the page, compact at rest: a small floating rectangle, centered (logo, accent dot, "[ Menu ]" button) in frosted glass.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Version

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

    Copies the version "Reference version". Pick another version above the preview to copy that one.
  2. Add custom CSS

  3. Add custom JS

  4. Tune it

    Custom attributes
    Select the section on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-anchored-menu Marks the section the effect plays on. It takes no value: leave the value field empty.
    data-anchored-menu-toggle Marks the button that opens and closes the menu. It can sit outside the menu, in a bar of its own. Without it nothing opens the menu but JavaScript, and the console says nothing. [ Required ]
    data-anchored-menu-panel Marks the block that unfolds. Without it the engine takes the last block inside the menu, and refuses to mount, with a warning in the console, when the menu holds a single block. [ Optional ]
    data-anchored-menu-links Marks the box holding the links that rise one after the other. Without it the engine takes the first nav inside the menu, and moves no link when there is none. [ Optional ]
    data-anchored-menu-link Marks one link to move, for links that do not all sit in the same box. As soon as one link carries it, only the marked links rise. [ Optional ]
    data-anchored-menu-mask Marks the box that clips a row while its link rises. Without it the engine wraps each link in a box it builds, and the hairline you drew between two rows is not on it. [ Optional ]
    data-anchored-menu-block Marks a side block that settles after the links, a contact card or a footer line. Without it the block is simply there from the start. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same section. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-anchored-menu-widen 0.45 How long the box takes to stretch from its compact width to the width of the panel, in seconds.
    data-anchored-menu-widen-ease power3.inOut Shape of the widening, where it speeds up and where it settles. Options: any GSAP ease, power2.out and expo.inOut for instance.
    data-anchored-menu-grow 0.5 How long the box takes to drop down to the height of the panel, in seconds.
    data-anchored-menu-grow-ease power3.inOut Shape of the drop in height. Options: any GSAP ease, power2.out and expo.inOut for instance.
    data-anchored-menu-grow-overlap 0.12 How early the height starts, counted back from the end of the widening, in seconds.
    data-anchored-menu-reveal 0.6 How long one link takes to rise out of its row, in seconds.
    data-anchored-menu-reveal-stagger 0.05 Delay between two links rising, in seconds.
    data-anchored-menu-reveal-ease power4.out Shape of the links rising. Options: any GSAP ease, back.out and power2.out for instance.
    data-anchored-menu-reveal-from 130 How far under its row a link starts out, as a percentage of a row height.
    data-anchored-menu-reveal-overlap 0.2 How early the links start, counted back from the end of the drop in height, in seconds.
    data-anchored-menu-lift clamp(10px, 1.55vh, 18px) How far a side block travels up while it fades in, the coordinates card and the foot line, any CSS unit.
    data-anchored-menu-blocks 0.4 How long one side block takes to settle in, in seconds.
    data-anchored-menu-blocks-stagger 0.06 Delay between two side blocks, in seconds.
    data-anchored-menu-blocks-ease power2.out Shape of the side blocks settling in. Options: any GSAP ease, back.out and power2.out for instance.
    data-anchored-menu-blocks-offset 0.05 Delay between the links starting to rise and the side blocks starting to fade, in seconds.
    data-anchored-menu-open-speed 1 Playback speed of the whole unfolding, 1 being the durations above.
    data-anchored-menu-close-speed 1.35 Playback speed of the folding back, which plays the same timeline backwards.
    data-anchored-menu-escape true Whether the Escape key closes the menu. Options: true, false.
    data-anchored-menu-close-on-outside true Whether a click anywhere outside the box closes the menu. Options: true, false.
    data-anchored-menu-close-on-link true Whether a click on a menu link closes the menu. Options: true, false, false being for links that open elsewhere.
    data-anchored-menu-remeasure 120 Delay before a box caught mid travel by a resize or a late face reads both sizes again, in ms. At rest nothing is read, the CSS sizes the box.
    data-anchored-menu-label-open [ Menu ] Text written in the button while the menu is closed. Options: any short phrase; a button holding an icon is left alone.
    data-anchored-menu-label-close [ Close ] Text written in the button while the menu is open. Options: any short phrase; a button holding an icon is left alone.
    data-anchored-menu-debug false Whether the engine writes what it read on the menu element, as data-anchored-menu-debug-* attributes (state, last event, size at the click, the two measured sizes, current size, inline size, GSAP version, mount time), and logs every change in the console. Options: true, false. On for a preview you cannot inspect, off on a live site.

What it does

Anchored expandable menu is an animated navigation component for Webflow and vanilla JavaScript, built on GSAP 3. Also called expanding floating navbar, floating navbar or dynamic island menu.

Navigation anchored at the top of the page, compact at rest: a small floating rectangle, centered (logo, accent dot, "[ Menu ]" button) in frosted glass. On click it unfolds into a panel without ever covering the page, in two crisp stages: the width stretches first, then the height drops down, the radius staying constant so the box reads as one rectangle that grows instead of a shape that morphs. The links then rise out of their mask in the left-hand column, the coordinates (mono // labels) settle into a recessed card on the right, and a system line plus the copyright close the panel. The "[ Close ]" button sits at the right edge of the expanded panel and has no effect on the compact state. Folding back is an accelerated rewind, on the button, on a click outside or on Escape. Both states are measured at the click, never guessed, and never frozen: at rest the box is sized by the CSS alone, whatever loaded after the page. Same art direction as the curtain-menu component: ink on cream, the ink #15100c as the one tint (dot, hovers, OK words, selection), terminal layer, scramble effect. Pattern type: expandable floating nav.

Updated

Questions

Paste the component, then tune it with custom attributes on the box marked data-anchored-menu, for instance data-anchored-menu-widen="0.6". The glass, the border, the radius and the width of the open panel are your own classes, and the engine never reads a class.

Yes, the GSAP 3 core with no plugins, and the embed loads 3.12.5. GSAP is read at each click, not at mount, so Webflow's own copy can land after the script and no second copy is loaded. Without GSAP the menu still opens: the state switches at once and the CSS sizes the box.

Use data-anchored-menu-widen for the sideways stretch, 0.45 seconds by default, and data-anchored-menu-grow for the drop in height, 0.5 seconds. Lower values snap the box open, higher ones make a slow, deliberate stretch. data-anchored-menu-open-speed scales the whole unfolding, and closing plays the same timeline backwards at 1.35 times the speed.

No. There is no overlay, no scroll lock and no focus trap: the panel unfolds from the bar and the page stays usable. It folds back on the button, on a click outside, on Escape or on a link click, and the last three can each be turned off, for instance data-anchored-menu-close-on-outside="false".

Because the box itself was given a width. A width on [data-anchored-menu] gives the closed and open states the same width, so only the height moves. Put the open width on the panel marked data-anchored-menu-panel and leave the box unsized.