
The inchworm menu
Menus, Hover, Transitions
The inbox tabs of Halyard, an invented mail app, in a dark glass card like a Dribbble shot: Primary, Updates and Mentions, each with its unread counter. Pick a tab and the glass pill jumps onto it on two springs, the leading edge pulled harder than the trailing one, so it stretches while it travels and gets a little thinner; the messages come in from the side you are heading to. Then they are read one at a time: the sender loses its bold, the counter rolls down a digit and at zero folds back into the tab, and the footer reads All caught up with a check that draws itself. Meanwhile new mail lands in the other tabs: their counter pops back out with a bounce and the sync icon turns once.
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>
<!--
"Inbox 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 inbox tabs with unread counters that drain</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 inbox of Halyard, an invented mail app: three tabs with their unread counters. The glass pill springs to the
tab you pick and stretches while it travels, the messages slide in from the side you are going, then they are
read one by one and the counter rolls down to zero and folds away. Mail keeps arriving in the other tabs. -->
<section class="mail" data-mail aria-labelledby="mail-title">
<span class="mail__glow" data-glow aria-hidden="true"></span>
<header class="mail__head">
<span class="mail__mark" aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M3 6.2 10 11l7-4.8"/><rect x="2.6" y="4.4" width="14.8" height="11.2" rx="2.6"/></svg>
</span>
<span class="mail__titles">
<span class="mail__app">Halyard</span>
<span class="mail__title" id="mail-title">Inbox</span>
</span>
<span class="mail__me" aria-hidden="true">LV</span>
</header>
<div class="tabs" role="tablist" aria-label="Mailboxes" data-tabs>
<span class="tabs__pill" data-pill aria-hidden="true"><span class="tabs__shine"></span></span>
<button class="tab" role="tab" type="button" data-tab="primary"><span class="tab__label">Primary</span><span class="badge" data-badge aria-hidden="true"><span class="badge__in"><span class="badge__col" data-col></span></span></span></button>
<button class="tab" role="tab" type="button" data-tab="updates"><span class="tab__label">Updates</span><span class="badge" data-badge aria-hidden="true"><span class="badge__in"><span class="badge__col" data-col></span></span></span></button>
<button class="tab" role="tab" type="button" data-tab="mentions"><span class="tab__label">Mentions</span><span class="badge" data-badge aria-hidden="true"><span class="badge__in"><span class="badge__col" data-col></span></span></span></button>
</div>
<div class="list" role="tabpanel" data-list aria-live="off"></div>
<footer class="mail__foot">
<span class="foot__state" data-state>
<span class="foot__line" data-line-a></span>
<span class="foot__line foot__line--b" data-line-b></span>
</span>
<span class="foot__sync" aria-hidden="true">
<svg viewBox="0 0 20 20" data-sync><path d="M15.5 8.2A5.8 5.8 0 0 0 4.7 7"/><path d="M4.5 3.8v3.4h3.4"/><path d="M4.5 11.8a5.8 5.8 0 0 0 10.8 1.2"/><path d="M15.5 16.2v-3.4h-3.4"/></svg>
</span>
</footer>
</section>
<svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.5 18.6 12l-6 1.4-3.2 5.6z"/></svg>
<p class="sr" aria-live="polite" data-live></p>
</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.
25 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 “Inbox tabs” from Animorio and fit it into my siteThe glass pill has no animated position and width: it has two edges, each with its own hand-written damped spring integrated in GSAP's ticker in four half steps. The edge you are heading to is pulled by STIFFNESS, the trailing one by STIFFNESS times STRETCH: the first leaves earlier, the second chases it, and the pill stretches on the way and shortens on arrival with a small bounce. The target is read from the tabs on every frame, so it also follows the counter folding away and changing the tab's width. With speed the pill gets thinner (SQUASH) and a light crosses it when it lands.
Changing tab, the old rows leave by SLIDE pixels on the opposite side and the new ones come in from the side you are heading to, STAGGER seconds apart. The list has the fixed height of four rows, measured on the screen height too, so the card does not jump.
READ_DELAY seconds after opening, the first unread message is read: the sender loses its bold with a transition of the variable font weight, the time turns grey and the row lights up for a moment. The counter is a column of digits from 0 to 9 inside a pill: it goes down a digit in ROLL seconds with a small overshoot. At zero it rolls to 0 and the pill folds into the tab, narrowing and shrinking; the footer turns to All caught up with a check that draws itself.
In the tabs you are not looking at, new messages arrive from a short list: the counter, if it was closed, pops back out widening with a bounce, otherwise it goes up a digit and swells for a moment on an elastic spring, and the sync icon turns once. The drawn pointer then opens that very tab; when the real pointer arrives it stops and mail keeps arriving now and then.
| Name | File | Default | What it changes |
|---|---|---|---|
STIFFNESS | script.js | 380 | The spring pulling the leading edge of the pill: higher is snappier. |
STRETCH | script.js | 0.5 | How hard the trailing edge is pulled compared with the leading one: lower stretches the pill more while it travels. |
DAMPING | script.js | 26 | How quickly the spring settles: lower overshoots and wobbles more. |
SQUASH | script.js | 0.12 | How much thinner the pill gets at full speed. |
READ_DELAY | script.js | 1.2 | Seconds between opening the tab and the first message being read. |
READ_STEP | script.js | 0.65 | Seconds between two messages being read. |
SLIDE | script.js | 26 | Pixels the messages travel when the tab changes. |
STAGGER | script.js | 0.05 | Seconds between two messages sliding in. |
ROLL | script.js | 0.45 | Seconds for the counter to roll to the next digit. |
LOOP | script.js | true | Left alone, a drawn pointer keeps reading the mail. |
In an app's mail, in a back office's notifications, in the messages of a marketplace or a freelance platform, in a help desk's tickets: wherever tabs have something new to count and the number must go down while you read.
The same animation with adapted sizes: the card is almost as wide as the screen, rows, headings and the tab bar are sized on the height too, so everything fits in the phone box. Tabs are tapped with a finger.
Nothing moves: the pill goes straight to the tab, the messages and the footer change with a fade, the counter changes digit in place and opens and closes with a fade, and there is no drawn pointer.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.2 KB; the libraries: GSAP 28 KB.
Tested on 8 November 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.