
The elastic button
Buttons, Hover, Text
The filter chips row of Ardmoor, a made-up sofa shop, on white: a chosen chip fills with walnut coloured liquid, runs to the front of the row and fuses with the other chosen ones into a single pill with thin dividers, while the free chips shift on a spring. Switched off, it leaves the pill on a thread of liquid that stretches, thins and snaps back in, and the chip returns to its place; the results count rolls at every choice and Clear puts them all back in 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>
<!--
"Fusing filter chips" 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 filter chips that fuse into a single pill</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 filter chips of a made-up furniture shop: a chosen chip runs to the front of the row and fuses with the
other chosen ones into one liquid pill with thin dividers; switched off, it leaves the pill through a thinning
drop and springs back to its place, and the count of the sofas left rolls -->
<section class="bar" data-bar aria-label="Filter the sofas">
<header class="bar__head">
<p class="count"><span class="count__num" data-num aria-hidden="true"></span><span class="count__noun" data-noun>results</span></p>
<span class="bar__where">Ardmoor <i>·</i> Sofas</span>
<button class="clear" type="button" data-clear disabled>
<span class="clear__in">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8a4.6 4.6 0 1 0 1.5-3.4"></path><path d="M4.4 2.4v2.6H7"></path></svg>
<span>Clear</span>
</span>
</button>
</header>
<div class="chips" data-chips role="group" aria-label="Filters">
<div class="goo" data-goo aria-hidden="true"></div>
</div>
<p class="sr" data-live aria-live="polite"></p>
</section>
<svg class="defs" width="0" height="0" aria-hidden="true">
<filter id="goo" x="-10%" y="-60%" width="120%" height="220%" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="5" result="blur"></feGaussianBlur>
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -10" result="goo"></feColorMatrix>
<feComposite in="SourceGraphic" in2="goo" operator="atop"></feComposite>
</filter>
</svg>
<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.
30 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 “Fusing filter chips” from Animorio and fit it into my siteUnderneath, a layer with the SVG goo filter (a blur, a threshold on alpha, feComposite atop to keep the colour crisp) where every chosen chip has its fill; on top, the real buttons with the white face, the divider and the word. When two fills touch the threshold welds the blur between them and they become a single shape, with its shadow as a drop-shadow.
The chips are absolutely positioned: the order is the chosen ones first, in the order they were chosen, then the free ones in their places. Between two chosen chips the gap is zero, between the others GAP pixels, and the row wraps when it is full. GSAP takes chips and fills to their new x and y with back.out, and the row’s height with them.
Every fill has its four radii apart: where it touches a neighbour on the same line the radius drops to 3 pixels halfway through the run, so the pill becomes continuous and the light divider by the word marks the joint.
When a chip is switched off its fill rounds off, shrinks and follows it; a small bead starts at the joint, is pulled STRETCH of the way and comes back with back.out. Inside the goo filter the three pieces make the neck that thins and snaps.
The made-up catalogue is one bit mask per sofa, drawn from a seeded random; the count is how many sofas have every chosen bit. Each digit has its own window: the new one comes in from below or above with a delay per position, and digits gained or lost widen or close on the left.
| Name | File | Default | What it changes |
|---|---|---|---|
FILTERS | script.js | Oak, Linen, Velvet, Modular, In stock, Under $900, Low back, Pet friendly | The filter chips, in the order of the row. |
TOTAL | script.js | 148 | How many sofas there are with no filters. |
GAP | script.js | 8 | The gap between two free chips, in pixels. |
MOVE | script.js | 0.62 | How long a chip’s run to the pill or back to its place lasts, in seconds. |
BOUNCE | script.js | 1.5 | How far the spring overshoots before it settles. |
STRETCH | script.js | 0.45 | How far the liquid thread stretches when a chip comes loose, from 0 to 1. |
NOUN | script.js | result, results | What is being counted, one and many. |
Above the product grid of an online shop for furniture, fashion or electronics, in the search of a recipe or listings app, in the quick filters of a category page: wherever the choices should sit together and read as one thing, and the results count should answer at once.
The bar narrows to the screen width minus thirty-two pixels, Ardmoor · Sofas goes away, the chips become 34 pixels tall and wrap on three lines; the pill of the chosen ones wraps too, one piece per line. A finger presses like the mouse; without hover the plus does not turn until it is touched.
No runs, springs, threads or rolling: a chosen chip darkens where it is, then fades out and back in already at the head of the pill; the count changes with a fade and Clear switches everything off the same way.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.1 KB; the libraries: GSAP 28 KB.
Tested on 13 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.