
The inchworm menu
Menus, Hover, Transitions
The tabs of a workspace, Overview, Usage and Members, over a single panel, clean on white: choosing one, the panel takes the height of the new page on a short spring, goes a pixel and a half too far and settles, while the old page leaves blurred and the new one comes in from its side. The line under the tab slides and lands a pixel past, and every page arrives with its own small gesture: the usage bars filling up, the team’s faces falling into line.
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>
<!--
"Auto-height tabs" 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 tabs with the panel that fits its content</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">
<!-- three tabs over one panel: choosing a tab, the panel springs to the height of the new page
(a pixel too far, then back) while the old page leaves blurred and the new one comes in from its side -->
<div class="slot" data-slot>
<section class="card" data-card aria-label="Workspace">
<div class="tabs" role="tablist" aria-label="Workspace" data-tabs>
<span class="tabs__hover" data-hover aria-hidden="true"></span>
<button class="tab" type="button" role="tab" id="tab-overview" aria-controls="pane-overview" aria-selected="true" tabindex="0" data-tab="0"><span>Overview</span></button>
<button class="tab" type="button" role="tab" id="tab-usage" aria-controls="pane-usage" aria-selected="false" tabindex="-1" data-tab="1"><span>Usage</span></button>
<button class="tab" type="button" role="tab" id="tab-members" aria-controls="pane-members" aria-selected="false" tabindex="-1" data-tab="2"><span>Members</span></button>
<span class="tabs__line" data-line aria-hidden="true"></span>
</div>
<div class="panel" data-panel>
<div class="pane" role="tabpanel" id="pane-overview" aria-labelledby="tab-overview" data-pane="0">
<div class="row">
<p class="plan">Pro plan</p>
<span class="badge" data-pop>Active</span>
</div>
<p class="muted">Renews on Nov 14 · $24 per month</p>
</div>
<div class="pane" role="tabpanel" id="pane-usage" aria-labelledby="tab-usage" data-pane="1">
<div class="meter">
<div class="row"><p>Requests</p><p class="muted">182k of 250k</p></div>
<div class="meter__track"><span class="meter__fill" data-fill="0.73"></span></div>
</div>
<div class="meter">
<div class="row"><p>Storage</p><p class="muted">6.4 of 10 GB</p></div>
<div class="meter__track"><span class="meter__fill" data-fill="0.64"></span></div>
</div>
<div class="meter">
<div class="row"><p>Bandwidth</p><p class="muted">41 of 100 GB</p></div>
<div class="meter__track"><span class="meter__fill" data-fill="0.41"></span></div>
</div>
<p class="muted small">Resets on Nov 1</p>
</div>
<div class="pane" role="tabpanel" id="pane-members" aria-labelledby="tab-members" data-pane="2">
<div class="faces" aria-label="7 members">
<span class="face" data-face>AK</span>
<span class="face" data-face>MR</span>
<span class="face" data-face>JL</span>
<span class="face" data-face>SO</span>
<span class="face face--more" data-face>+3</span>
</div>
<p class="muted">7 members · 2 invites pending</p>
</div>
</div>
</section>
</div>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</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.
35 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 “Auto-height tabs” from Animorio and fit it into my siteThe three pages all sit at the top of the panel, absolutely positioned: that way they can be measured even when hidden (visibility hidden and inert, not display none) and the old and new can overlap during the change.
The panel has a height in pixels, taken from the offsetHeight of the chosen page. On change it goes to the new one plus OVERSHOOT in the direction of travel with power3.out, then back to exact with sine.inOut: that is the pixel too far, the same every time, with no spring wobbling at random.
The old one moves SHIFT pixels to the opposite side, fades and blurs with a filter blur; the new one starts 100 milliseconds later from the side of the chosen tab and arrives in focus. The direction comes from the order of the tabs, so the pages seem to sit in a row.
The line under the tab is a single span: GSAP changes its x and width to the new word plus one pixel, then brings it back. The chosen name goes from 500 to 620 on Mona Sans’s weight axis, through an animated CSS variable.
Each page does its own thing when it arrives: the usage bars grow from scaleX 0 to their value (written in data-fill), the faces come in from the left with back.out one after the other, the Active label swells from 0.9.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #3b5bdb | The colour of the usage bars and of the Active label. |
SPEED | script.js | 1 | The speed of everything: 2 twice as fast, 0.5 half. |
OVERSHOOT | script.js | 1.5 | How many pixels the panel goes past its new height before settling. |
SHIFT | script.js | 12 | How many pixels the new page travels in from its side. |
BLUR | script.js | 4 | How much the leaving page blurs, in pixels. |
PAUSE | script.js | 1.8 | The seconds on each tab when the pointer tries them by itself. |
AUTO | script.js | true | The drawn pointer tries the tabs by itself until someone touches them. |
For the tabs of a dashboard, of account settings or of a product page, when the pages have different lengths: the panel does not jump, it adapts, and the page below does not lurch.
On the phone the panel takes almost the whole width and the tabs stay on one row; there is no grey hover background, everything else is the same.
The panel takes its new height at once, the pages and the line swap with a fade, with no movement or blur; the bars are already full.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.5 KB; the libraries: GSAP 28 KB.
Tested on 31 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.