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
VaultNavigationElastic Pill Menu
Pile to Spread CardsBrowse all 182Pill Gauge Stepper
  • 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

Elastic Pill 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
  • CustomEase

Setup

npm i gsapregisterPlugin(CustomEase)

More like this

  • Menu
  • Elastic
  • Split text
  • Morph

Features.

  • The Menu pill is the menu: its real width, height and corners pour open into the panel, so the frosted glass, blur and rounding never stretch
  • An elastic open with the height a beat behind the width, and a softer elastic on the way back that rings just past pill size before it settles
  • One timeline per open or close, built from the live size: a click mid-morph turns around from wherever it is
  • Links rise in letter by letter, and roll onto a copy of themselves on hover or keyboard focus
  • Each link takes hovers as soon as its own letters have landed
  • An image link beside the list zooms, shades and rolls in a caption on hover
  • The Menu label rolls to Close while the dot grid rolls to a cross; while closed the dots pulse from the centre on hover and every 6 seconds
  • Escape, a click outside the pill, the toggle or tabbing away closes; focus moves to the first link on open and back to the toggle on close (unless you tabbed away)
  • Screen readers hear each link's words once (an aria-label is set), not letter by letter
  • Stacks the image above the links at 767px and below
  • The panel scrolls on screens shorter than itself, such as a phone in landscape
  • Respects prefers-reduced-motion: it swaps open and shut with no animation, and the dot pulse is off
  • GSAP and CustomEase, plain CSS for the look

How to get it right.

Give the glass something to blur

The pill and panel are a frosted surface (backdrop-filter: blur(2.5em) saturate(1.4)). Over a flat colour they read as a plain grey box; put them over a photo or a busy page.

Keep the links short

Link labels don't wrap. Four labels of two or three words fit the 37.5em panel; longer ones need a smaller font-size on .plm_link-text or a wider .plm_panel.

Size the panel, not the surface

The panel is a fixed-size box (.plm_panel: width, height and border-radius). The script reads its size and radius on every open and grows the pill to match, so that's the only place to change the open shape.

Tune the spring with the period

data-au-elastic is the period of elastic.out(1, …): 0.4 rings like a bell, 1 barely overshoots. Pair a lower period with a longer data-au-duration so the ring has time to settle.

Variations.

  • Default — 1s morph on elastic.out(1, 0.7)
  • Bouncy — data-au-elastic="0.4" and data-au-duration="1.4"
  • Calm — data-au-elastic="1.05" and data-au-duration="0.7": opens with barely any overshoot
  • No image — remove the .plm_media link; set .plm_body to one column
  • Your colours — override --plm-glass, --plm-fg, --plm-text, --plm-scrim and --plm-accent on .plm_menu

Where it fits.

  • Fashion and lifestyle sites — a centred pill over a full-bleed photo
  • Portfolios and landing pages — a compact menu that stays out of the way of the hero
  • Product launches — four sections and one featured image link

Frequently asked.

Yes. Set --plm-glass to a darker tint (for example rgb(37 36 34 / 0.12)) and --plm-fg / --plm-text to dark colours.

Put <span class="plm_badge" data-plm-badge>New</span> after the link's [data-plm-word] span. Screen readers then hear the link as "…, new".

Closed, the pill hugs the toggle. The script measures the toggle on start and again once the page fonts have loaded, so a late web font doesn't leave a gap.

Not by itself: links are ordinary anchors and navigate as usual. In a single-page app call window.au.PillMenu.refresh() after the route changes to reset it closed.

Each [data-au-pill-menu] is its own instance, but it's a site menu: one per page is what it's made for. Give each panel a unique id if you use two.

The hero is one image and the logo by default. Add a .plm_copy block after the logo, with .plm_title and .plm_lede inside. The styles are still in code.css. In React, pass your own hero as children.

Related components.

NewPro

Ink Spread Menu

Click

Pro

Folding Burger Nav

Scroll

Pro

Full-Screen Wipe Menu

Click