Skip to content
animorio
IT
All components

Mute button

Buttons, HoverGSAP, CSS onlyEasyCompressed weight: Demo 4.2 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

13 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 “Mute button” 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 white, alone in the middle, there is a black pill with a speaker drawn in a few geometric strokes, two sound waves beside it and the word «Mute». On tap the pill gives a little and comes back on a spring; the two waves fold back into the speaker one after the other, the outer one first, and the speaker recoils by a hair as if hit. Then a slash in the accent colour draws across the speaker: it cuts it with a thin line in the pill’s colour, goes a pixel too far and settles. Meanwhile «Mute» rises away and «Muted» arrives, coming in narrow and opening up on the width axis; the pill stretches on a spring as much as the new word needs. On a second tap the slash slides off the far end, the waves come back out of the speaker, the inner one first, each overshooting by a pixel, and «Mute» returns. Hovering brings the pill a touch closer and the waves breathe once. Until someone touches it, the pill plays the gesture by itself.

How it works

A single sign

The 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 folding back

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 drawing itself

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 word coming in narrow

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ff5a3cThe colour of the slash across the speaker.
LABEL_ONscript.jsMuteThe word while the sound is on.
LABEL_OFFscript.jsMutedThe word once it is muted.
SPRINGscript.js1How springy the press and the waves are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2.2How many seconds each state stays when the button plays by itself.
AUTOscript.jstrueThe button plays the gesture by itself until someone touches it.

Try them in the Playground

When to use 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 phones

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.

With reduced motion

The waves, the slash and the words swap with a fade, with no springs or movement; the pill takes its new width at once.

Pitfalls

  • The new word’s width has to be measured before it comes in narrow: measured afterwards, with the wdth axis at 75, the pill would stretch too little and the word would spill over the edge.
  • Both words sit in the same grid cell: with width max-content each has its own width, otherwise the cell takes the wider one and the measure is wrong.
  • The press scale has to be divided out when measuring: if the pill is at 0.95 while measuring, the word comes out shorter.

Libraries

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.

Testing

Tested on 30 October 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