
The elastic button
Buttons, Hover, Text
One button, one sign, in the simple style of product interface pieces: the black «Mute» pill with a speaker drawn in a few strokes; on tap the two sound waves fold back into the speaker, a slash in the accent colour cuts across it and the label becomes «Muted». On a second tap the slash slides away and the waves come back out, each one overshooting by a pixel.
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>
<!--
"Mute button" 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 Mute button with the sound waves folding back</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>
<!-- one button, one sign: the two sound waves fold back into the speaker and a slash draws across it -->
<button class="mute" type="button" data-mute aria-pressed="false" aria-label="Mute">
<span class="mute__body" data-body>
<svg class="mute__icon" viewBox="0 0 32 32" aria-hidden="true">
<g data-speaker>
<path class="mute__speaker" d="M6.5 12.5h3.6l5.4-4.6v16.2l-5.4-4.6H6.5a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1Z"/>
</g>
<path class="mute__wave" data-wave d="M19.4 12.6a4.4 4.4 0 0 1 0 6.8"/>
<path class="mute__wave" data-wave d="M22.2 9.6a8.6 8.6 0 0 1 0 12.8"/>
<path class="mute__slash mute__slash--gap" data-gap d="M7 6.5 25.5 25"/>
<path class="mute__slash" data-slash d="M7 6.5 25.5 25"/>
</svg>
<span class="mute__label" aria-hidden="true">
<span class="mute__word" data-word="on">Mute</span>
<span class="mute__word" data-word="off">Muted</span>
</span>
</span>
</button>
</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.
13 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 “Mute button” from Animorio and fit it into my siteThe icon is an SVG of five paths: the speaker body, the two waves and the slash, drawn twice. Underneath is the same slash, thicker and in the pill’s colour: it is what cuts the speaker with an empty line, with no masks.
The waves scale to zero around the mouth of the speaker (svgOrigin 16 16), the outer one first, with power2.in: they look sucked in. On the way back they come out with back.out, the inner one first, and the one-pixel bounce comes from the ease.
The slash draws with strokeDashoffset from its length to minus 0.9, a pixel past the end, then back to zero with power2.inOut: that is the settle. To remove it, it goes to minus the length, so it slides off the far end instead of retracting where it came from.
The old word rises and leaves before the new one arrives, which comes up from below with the wdth axis at 75 and the weight at 420 and lands at 100 and 560 with back.out: the two are never read together. The pill’s width follows the new word, measured in its final shape.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #ff5a3c | The colour of the slash across the speaker. |
LABEL_ON | script.js | Mute | The word while the sound is on. |
LABEL_OFF | script.js | Muted | The word once it is muted. |
SPRING | script.js | 1 | How springy the press and the waves are: 0.4 calm, 2 very bouncy. |
SPEED | script.js | 1 | The speed of everything: 2 twice as fast, 0.5 half. |
HOLD | script.js | 2.2 | How many seconds each state stays when the button plays by itself. |
AUTO | script.js | true | The button plays the gesture by itself until someone touches it. |
For the button that mutes the sound in a video call, a video player or a story: the sign says by itself what happened, with no need for a notice.
On the phone the pill and the icon take their size from the screen (clamp on the shorter side); there is no hover, everything else is the same.
The waves, the slash and the words swap with a fade, with no springs or movement; the pill takes its new width at once.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.2 KB; the libraries: GSAP 28 KB.
Tested on 30 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.