Skip to content
animorio
IT
All components

Fusing filter chips

Tags, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a white background there is the sofa filter bar of Ardmoor, a made-up furniture shop: top left the number of results, large, with the word results in grey, in the middle Ardmoor · Sofas and on the right Clear with its turning back arrow, switched off until there is something to clear. Below, eight white pill shaped chips with a thin sand coloured border and a grey plus in front: Oak, Linen, Velvet, Modular, In stock, Under $900, Low back and Pet friendly, which come in one after the other with a little bounce when the page opens. On hover a chip lifts by a pixel, its border darkens, its shadow grows and the plus turns and goes terracotta; pressed, it squeezes and springs back. Chosen, walnut coloured liquid wells up under it, squashed then round, the words go light and a little wider and the plus turns into a cross; then it runs to the front of the row and fuses onto the end of the other chosen chips: where they touch the liquid makes a bridge, the corners tighten and what is left is a single pill with a thin glowing divider between one word and the next. As it lands the pill gulps: the new piece swells by a pixel and settles. The free chips shift to the right and wrap to the next line on a spring that overshoots and comes back. Switched off, a chip’s liquid rounds off and leaves the pill pulling a thread that stretches and thins, becomes a drop that follows the chip and fades, while the thread snaps back into the pill like an elastic; the chip returns white to its place and the pill closes on a spring. At every choice the count rolls digit by digit, upwards when it drops and downwards when it grows. Clear puts every chosen chip back in line, from the last to the first, each with its own drop. Left alone, a drawn pointer chooses Linen, In stock and Velvet, takes In stock off and then presses Clear.

How it works

Three layers for one pill

Underneath, 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 planned row

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.

Corners that tighten

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.

The thread that comes loose

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 rolling count

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.

Values to change

NameFileDefaultWhat it changes
FILTERSscript.jsOak, Linen, Velvet, Modular, In stock, Under $900, Low back, Pet friendlyThe filter chips, in the order of the row.
TOTALscript.js148How many sofas there are with no filters.
GAPscript.js8The gap between two free chips, in pixels.
MOVEscript.js0.62How long a chip’s run to the pill or back to its place lasts, in seconds.
BOUNCEscript.js1.5How far the spring overshoots before it settles.
STRETCHscript.js0.45How far the liquid thread stretches when a chip comes loose, from 0 to 1.
NOUNscript.jsresult, resultsWhat is being counted, one and many.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The goo filter on white faces with borders would have smudged them together: the goo layer holds only the dark fills of the chosen chips, and the bordered white faces live in the buttons above, which turn transparent when the liquid arrives.
  • With only the alpha threshold the pill’s colour got dirty along the blur’s edges: feComposite atop puts the crisp shape back on top and leaves the blur only the bridges between one piece and the next.
  • GSAP moves the buttons’ x, y and scale, so the one pixel hover lift and the turning cross live in the children, chip__in and the icon, with CSS transitions.
  • On resize and when the typeface arrives the widths change: the row is measured again and put back in place without animation, stopping only the x and y runs, so the entrance fades are not left halfway.

Libraries

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.

Testing

Tested on 13 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components