
The inchworm menu
Menus, Hover, Transitions
In the style of product interfaces: the dropdown to switch workspace in a team app. The button shows the tile with the initials, the name and the plan; pressed, the panel opens on a short spring, a soft highlight slides under the row you point at and the check draws itself on the one you pick. Then the button changes name: a small spinner while it loads, the tile turning, the old name rising away and the new one coming in, with the width stretching or shrinking.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"The workspace switcher menu" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The workspace switcher menu</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the workspace switcher of a team app. The button shows the workspace you are in, its tile with the initials
and its plan. Pressed, a panel opens on a short spring; a soft highlight slides under the row you point at,
the check draws itself on the one you choose, and the button changes name with its width animated -->
<div class="switcher" data-frame>
<button class="trigger" type="button" aria-haspopup="listbox" aria-expanded="false" aria-controls="ws-list" data-trigger data-autoclic>
<span class="trigger__press" data-press>
<span class="tile" data-tile><span class="tile__letters" data-tile-letters>FS</span></span>
<span class="trigger__text" data-text>
<span class="trigger__line" data-line>
<span class="trigger__name">Fernway Studio</span>
<span class="trigger__plan">Pro plan</span>
</span>
</span>
<span class="trigger__end">
<svg class="trigger__spin" viewBox="0 0 16 16" aria-hidden="true" data-spin><circle cx="8" cy="8" r="5.6" class="spin__track"/><path d="M8 2.4a5.6 5.6 0 0 1 5.6 5.6" class="spin__arc"/></svg>
<svg class="trigger__chev" viewBox="0 0 16 16" aria-hidden="true" data-chev>
<path d="M5 6.2 8 3.4l3 2.8" data-chev-up/>
<path d="M5 9.8 8 12.6l3-2.8" data-chev-down/>
</svg>
</span>
</span>
</button>
<div class="panel" data-panel hidden>
<div class="panel__head">
<span class="panel__label">Workspaces</span>
<span class="panel__mail">ines@fernway.studio</span>
</div>
<div class="panel__list-wrap">
<span class="hl" aria-hidden="true" data-hl></span>
<ul class="panel__list" id="ws-list" role="listbox" aria-label="Workspaces" tabindex="-1" data-list>
<li class="opt" role="option" aria-selected="true" id="ws-fernway" data-opt data-name="Fernway Studio" data-plan="Pro plan" data-letters="FS" data-hue="0">
<span class="tile tile--hue0"><span class="tile__letters">FS</span></span>
<span class="opt__text"><span class="opt__name">Fernway Studio</span><span class="opt__meta"><span class="badge badge--pro">Pro</span>12 members</span></span>
<svg class="check" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4 6.6 11.2 12.4 4.9" data-check/></svg>
</li>
<li class="opt" role="option" aria-selected="false" id="ws-quillmark" data-opt data-name="Quillmark" data-plan="Pro plan" data-letters="Q" data-hue="1">
<span class="tile tile--hue1"><span class="tile__letters">Q</span></span>
<span class="opt__text"><span class="opt__name">Quillmark</span><span class="opt__meta"><span class="badge badge--pro">Pro</span>28 members</span></span>
<svg class="check" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4 6.6 11.2 12.4 4.9" data-check/></svg>
</li>
<li class="opt" role="option" aria-selected="false" id="ws-orbit" data-opt data-name="Orbit Labs" data-plan="Free plan" data-letters="OL" data-hue="2">
<span class="tile tile--hue2"><span class="tile__letters">OL</span></span>
<span class="opt__text"><span class="opt__name">Orbit Labs</span><span class="opt__meta"><span class="badge">Free</span>3 members</span></span>
<svg class="check" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4 6.6 11.2 12.4 4.9" data-check/></svg>
</li>
<li class="opt" role="option" aria-selected="false" id="ws-personal" data-opt data-name="Personal" data-plan="Free plan" data-letters="IM" data-hue="3">
<span class="tile tile--hue3"><span class="tile__letters">IM</span></span>
<span class="opt__text"><span class="opt__name">Personal</span><span class="opt__meta"><span class="badge">Free</span>Only you</span></span>
<svg class="check" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4 6.6 11.2 12.4 4.9" data-check/></svg>
</li>
<li class="opt opt--create" role="option" aria-selected="false" id="ws-create" data-opt data-create>
<span class="plus" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M8 3.5v9M3.5 8h9"/></svg></span>
<span class="opt__text"><span class="opt__name">Create workspace</span></span>
<span class="keys" aria-hidden="true"><kbd>Ctrl</kbd><kbd>N</kbd></span>
</li>
</ul>
</div>
</div>
<!-- the preview's pointer, only while the tour runs -->
<svg class="ghost" viewBox="0 0 20 24" aria-hidden="true" data-ghost>
<path d="M3 2.5v16.2l4.2-3.9 2.7 6.1 2.9-1.3-2.7-6h5.9z"/>
</svg>
<p class="sr" aria-live="polite" data-live></p>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
48 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “The workspace switcher menu” from Animorio and fit it into my siteThe panel opens with a single GSAP tween on opacity, a scale from 0.94 and 6 pixels of movement, with back.out (OPEN_BOUNCE): it goes a touch too far and settles, like the stiff springs of today's apps. The transform origin is the top centre, under the button, and the rows arrive STAGGER seconds apart.
The highlight of the row you point at is one element under the list, moved by GSAP with a y and a height measured from the row (offsetTop, offsetHeight). On the way it stretches a little vertically, more if it jumps more rows, and goes back to its height as it lands; when the pointer leaves the list it fades, and when it comes back it appears straight under the row, with no journey.
Each row has its SVG check with a stroke-dasharray of 14: the chosen one goes from 14 to 0 and is drawn, the old one goes from 0 to -14 and is erased in the direction it was drawn, then gets ready again.
The button measures the width of the old name, adds the new line to the flow and measures it, then fixes the old width and takes it to the new one in WIDTH_TIME seconds: the button stretches or shrinks by itself. Meanwhile the old name rises with yPercent -100, the new one comes in from 100 with a small back.out, and the tile turns on its vertical axis and changes colour and initials when it is edge on.
For SWITCH_WAIT seconds the switch shows it is in progress: the arrows shrink and a small indigo ring spins in their place, the name dims halfway. At the end the button drops a pixel and comes back, and the arrows return with a bounce.
The button has aria-haspopup and aria-expanded, the list is a listbox with aria-activedescendant and aria-selected. Arrow down opens, the arrows move the highlight, Home and End go to the ends, Enter chooses, Esc and Tab close and bring the focus back to the button, Ctrl N picks Create workspace; a click outside closes. The preview's click (detail 0) makes a tour with the fake pointer.
| Name | File | Default | What it changes |
|---|---|---|---|
OPEN_TIME | script.js | 0.34 | The seconds the panel takes to open. |
OPEN_BOUNCE | script.js | 1.25 | How far the panel overshoots before it settles (1, not at all). |
SLIDE_TIME | script.js | 0.26 | The seconds of the highlight sliding from one row to the next. |
WIDTH_TIME | script.js | 0.42 | The seconds of the button stretching or shrinking to the new name. |
STAGGER | script.js | 0.025 | The seconds between one row and the next as the panel opens. |
SWITCH_WAIT | script.js | 0.55 | How long the loading lasts before the new name lands. |
In the sidebar or header of a team app, a SaaS tool or a dashboard with several workspaces, organisations, projects or stores. It suits three, four or five rows; longer lists need a search at the top.
The menu is at most as wide as the screen less 32 pixels and the panel sits under the button inside the frame; below 340 pixels the address at the top is left out. On touch the highlight goes under the row you tap and picks it.
No springs and no movement: the panel fades in, the highlight jumps from row to row, the check is in place at once and the new name replaces the old one in a fade, already at the right width.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.6 KB; the libraries: GSAP 28 KB.
Tested on 24 October 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.