
The elastic button
Buttons, Hover, Text
The Wi-Fi row of a settings screen: switched on, the knob slides on a spring and stretches on the way, the arcs of the icon draw themselves from the dot outwards like waves, Off below becomes Searching with three small arcs that breathe, then the tile floods with blue from the dot and the small arcs turn into the signal strength next to Home-5G · Connected. Switched off, the arcs go out from the outside in.
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>
<!--
"Wi-Fi toggle" 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 Wi-Fi toggle with arcs that light up in waves</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 Wi-Fi row of a settings screen: switched on, the arcs of the icon draw themselves from the dot outwards like
waves, the knob slides on a spring and stretches on the way, the line below goes from Off to Searching with
three small arcs that breathe, then the tile floods with colour from the dot and the arcs settle into the signal
strength next to the network name; switched off, the arcs go out from the outside in -->
<div class="row" data-row>
<span class="row__light" aria-hidden="true"></span>
<span class="tile" data-tile aria-hidden="true">
<span class="tile__flood" data-flood></span>
<svg class="wifi" viewBox="0 0 24 24">
<g class="wifi__base">
<path d="M9.03 13.53A4.2 4.2 0 0 1 14.97 13.53"></path>
<path d="M6.63 11.13A7.6 7.6 0 0 1 17.37 11.13"></path>
<path d="M4.22 8.72A11 11 0 0 1 19.78 8.72"></path>
</g>
<g class="wifi__lit">
<path data-arc pathLength="100" d="M9.03 13.53A4.2 4.2 0 0 1 14.97 13.53"></path>
<path data-arc pathLength="100" d="M6.63 11.13A7.6 7.6 0 0 1 17.37 11.13"></path>
<path data-arc pathLength="100" d="M4.22 8.72A11 11 0 0 1 19.78 8.72"></path>
</g>
<circle class="wifi__dot" data-dot cx="12" cy="16.6" r="1.55"></circle>
</svg>
</span>
<span class="text">
<span class="text__title" id="wifi-title">Wi-Fi</span>
<span class="sub">
<span class="meter" data-meter aria-hidden="true">
<svg viewBox="0 0 16 12">
<path data-bar d="M5.8 9.6A3.1 3.1 0 0 1 10.2 9.6"></path>
<path data-bar d="M3.7 7.5A6.1 6.1 0 0 1 12.3 7.5"></path>
<path data-bar d="M1.6 5.4A9.1 9.1 0 0 1 14.4 5.4"></path>
</svg>
</span>
<span class="sub__clip"><span class="sub__word" data-sub>Off</span></span>
</span>
</span>
<button class="switch" type="button" role="switch" aria-checked="false" aria-labelledby="wifi-title" data-switch>
<span class="switch__track" data-track></span>
<span class="switch__knob" data-knob><span class="switch__shine"></span></span>
</button>
<p class="sr" data-live aria-live="polite"></p>
</div>
<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.
17 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 “Wi-Fi toggle” from Animorio and fit it into my siteEach lit arc has pathLength="100" and a dash of length a followed by a gap of 200: with stroke-dashoffset equal to a/2 − 50 the visible stroke always stays centred on the arc. GSAP takes a from 0 to 100 with a stagger (WAVE) from the inner arc to the outer one, while the stroke width rises to 2.9 and back to 2.1: the wave is born at the dot.
The knob is described by two numbers, p (0 off, 1 on) and w (its width). Its x is p·20 − (w − 28)·p: resting on the left it stretches to the right, resting on the right it stretches to the left, mid-way on both sides. p runs on elastic.out(1, 0.78), which overshoots by a pixel and settles; w goes up to 35 and back to 28 on a softer spring.
Inside the tile there is a 92-pixel circle centred on the dot of the icon, at scale 0. On connecting it scales to 1 with power3.out and covers the tile starting from the dot; the arcs turn white with the same stagger, so they colour as the blue reaches them, and the arcs past the signal strength pull back, showing their white trace at 34% underneath.
The state below Wi-Fi is a single span inside an 18-pixel window: it leaves upwards with power2.in, changes its text and comes back from below with back.out. In front of it a small SVG of three arcs opens in width; while searching a looping timeline raises and lowers their opacity from the inside out, and once connected it stops on the signal strength (SIGNAL).
The button has role="switch" and aria-checked, the whole row is tappable, the keyboard switches it with Enter or Space and an aria-live span says Wi-Fi on, Connected to Home-5G, Wi-Fi off.
| Name | File | Default | What it changes |
|---|---|---|---|
NETWORK | script.js | Home-5G | The name of the network that connects. |
ACCENT | script.js | #2f6bff | The colour of the switch, the arcs and the flooded tile. |
SIGNAL | script.js | 2 | The signal strength: how many of the three arcs stay lit once connected. |
SPRING | script.js | 0.75 | How long the knob’s spring lasts, in seconds. |
WAVE | script.js | 0.13 | How many seconds between one arc and the next in the wave that lights up. |
SEARCH | script.js | 1.9 | How many seconds it stays on Searching before connecting. |
HOLD | script.js | 2.6 | How many seconds it stays connected before the pointer switches it off, when left alone. |
In the settings of a smart home app, a router, a printer or a camera, in the control panel of an operating system or a desktop app, in the onboarding of a device that joins a network: wherever switching Wi-Fi on should also show what is happening.
The row narrows to the screen width minus thirty-two pixels and a long network name ends with an ellipsis; the whole row is tappable and the knob stretches under the finger as with the mouse. Without a hovering mouse the light that follows the pointer stays off.
No springs, waves or flooding: the knob changes side with a fade, the arcs appear already whole, the blue of the tile fades in, the small arcs below stay still and the words change with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.6 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.