
The inchworm menu
Menus, Hover, Transitions
The active filters bar over the results of Larchway, a made-up camping gear shop, in the premium style of Dribbble shots: the chosen filters are pills with an x drawn in SVG. When they no longer fit the row, the last ones stack and fall into a green +3 pill whose number rolls; hovering it fans the pile open. Removing a pill squashes it away while the others close up on a spring, a pill from the pile comes back to the row if there is room and the number of results rolls; Clear all sends them off in a cascade.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React tab holds the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Active filter pills" 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 active filters in pills that gather in the count</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" data-stage>
<!-- the active filters bar of Larchway, a made-up camping gear shop: the filters chosen are pills with a drawn x.
When they do not fit the row, the last ones stack and fly into a +3 pill whose count rolls; hovering it fans
the pile open. Removing a pill squashes it away while the others close up on a spring, and the results roll -->
<section class="panel" data-panel aria-label="Active filters">
<header class="panel__head">
<div class="panel__title">
<span class="panel__crumb">Larchway <span class="panel__sep">/</span> Tents & shelters</span>
<p class="panel__count"><span class="roll" data-results>128</span> <span class="panel__word">results</span></p>
</div>
<button class="clear" type="button" data-clear>
<span class="clear__face">Clear all</span>
</button>
<button class="clear clear--restore" type="button" data-restore hidden>
<svg class="clear__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 6.4a5 5 0 1 1 .4 4.4"/><path d="M3 2.8v3.8h3.8"/></svg>
<span class="clear__face">Restore filters</span>
</button>
</header>
<div class="row" data-row>
<p class="row__empty" data-empty>No filters on. Showing every tent and shelter.</p>
<div class="more" data-more>
<button class="more__btn" type="button" data-more-btn aria-expanded="false" aria-haspopup="true">
<span class="more__pile" aria-hidden="true"></span>
<span class="more__face" data-more-face>
<span class="more__plus" aria-hidden="true">+</span><span class="roll" data-more-n>3</span>
<span class="sr">more filters</span>
<span class="more__sheen" data-sheen aria-hidden="true"></span>
</span>
</button>
</div>
</div>
<div class="results" data-results-list aria-hidden="true">
<div class="tile" data-tile>
<span class="tile__swatch tile__swatch--pine">
<svg viewBox="0 0 64 40"><path d="M10 33 32 9l22 24"/><path d="M32 9v24"/><path d="M26 33l6-9 6 9"/><path d="M6 33h52"/></svg>
</span>
<span class="tile__name">Ridge 2 Tent</span>
<span class="tile__meta"><span>$289</span><span class="tile__dim">1.8 kg</span></span>
</div>
<div class="tile" data-tile>
<span class="tile__swatch tile__swatch--sand">
<svg viewBox="0 0 64 40"><path d="M8 33c6-14 14-21 24-21s18 7 24 21"/><path d="M20 33c3-8 7-12 12-12s9 4 12 12"/><path d="M5 33h54"/></svg>
</span>
<span class="tile__name">Cinder UL 2</span>
<span class="tile__meta"><span>$349</span><span class="tile__dim">1.1 kg</span></span>
</div>
<div class="tile tile--third" data-tile>
<span class="tile__swatch tile__swatch--slate">
<svg viewBox="0 0 64 40"><path d="M7 33 20 17h26l11 16"/><path d="M20 17l6 16"/><path d="M5 33h54"/></svg>
</span>
<span class="tile__name">Talus Bivy</span>
<span class="tile__meta"><span>$199</span><span class="tile__dim">0.9 kg</span></span>
</div>
</div>
</section>
<svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></svg>
<p class="sr" aria-live="polite" data-live></p>
</main>
<template data-pill-tpl>
<div class="pill">
<span class="pill__in">
<span class="pill__key"></span><span class="pill__label"></span>
<button class="pill__x" type="button">
<svg viewBox="0 0 16 16" aria-hidden="true"><path class="pill__x-a" pathLength="1" d="M5 5l6 6"/><path class="pill__x-b" pathLength="1" d="M11 5l-6 6"/></svg>
</button>
</span>
</div>
</template>
<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.
37 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 “Active filter pills” from Animorio and fit it into my siteThe pills are all absolute in the row and GSAP puts them in place with x and y. A function adds up the widths (offsetWidth, which ignores transforms) with the gaps: if they do not all fit, it keeps only those that also leave room for the +N pill, and the rest go to the pile. Widths and row are read again on resize, and everything goes back in place without animation.
In the pile the pills sit at the centre of the +N, scaled to 0.45 and transparent (with inert, so the Tab key does not find them). With the fan open they go under the +N, one per step, aligned to the side of the nearest edge, with an offset that grows with the square of the step and a rotation from -2.4 to +2.4 degrees around the +N side, staggered by 60 milliseconds.
The moves use an ease that is the response of a damped spring (1 − e^(−ζωt)(cos ωd t + …), normalised so it ends at 1): with BOUNCE at 0.82 a pill moving a hundred pixels passes the mark by less than a pixel and settles. The same spring, softer, rolls the digits.
Each digit of the results and of the +N is a column of 0 to 9, ten lines tall, inside a window one line tall with a soft mask on top and bottom. Changing the number means moving each column with yPercent = −digit × 10, right to left with a 35 millisecond stagger. The window needs align-items: flex-start, or flexbox stretches the column to one line.
The removed pill widens and flattens in 90 milliseconds (scaleX 1.07, scaleY 0.8), then closes into itself and is gone; a tenth of a second later the row rearranges, so the squash reads before the others arrive. Clear all starts from the rightmost pill: each squashes and drops 14 pixels with a 4 degree turn.
| Name | File | Default | What it changes |
|---|---|---|---|
BOUNCE | script.js | 0.82 | The spring of the pills: lower passes the mark further and comes back (0.6), 1 lands with no overshoot. |
SPEED | script.js | 1 | The speed of every move: 2 twice as fast, 0.5 half. |
GAP | script.js | 8 | The space between two pills, in pixels. |
FAN | script.js | 1 | How much the pile turns as it fans open (0 a straight list). |
STACK | script.js | 0.06 | The delay between one pill and the next in the cascades, in seconds. |
TOTAL | script.js | 412 | The results with no filter on. |
LOOP | script.js | true | The drawn pointer plays the story again and again. |
For the results page of an online shop, a catalogue or a search with many filters (homes, travel, job offers, products): it keeps the row of active filters on one line, phone included, without losing sight of how many there are and without wrapping the page. It also works in a dashboard with filtered tables.
The same animation with adapted sizes: the panel is 94% of the screen wide, two pills fit the row and the other five go into the +5, the fan tightens its steps to fit the frame and there are two products. On touch the +N opens and closes the fan, and a tap outside closes it.
Nothing moves: the pills fade in and out in their place, the fan opens with a fade already spread, the digits change at once with a flash of opacity 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 11 KB; the libraries: GSAP 28 KB.
Tested on 7 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.