
The elastic button
Buttons, Hover, Text
The Wi-Fi row in a device’s settings: the switch slides on a spring with a knob that stretches, the arcs of the icon light up from the centre in waves while it searches, then it connects and the nearby networks drop in underneath with their signal bars. Tap another network to join it, and switching off puts the arcs 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 bars 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 bars that light up</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 device's settings: the switch slides on a spring with a knob that stretches, the arcs of the
icon light up from the centre in waves while it searches, then it connects and the nearby networks drop in
underneath. Tap another network to join it; switching off puts the arcs out from the outside in -->
<section class="card" data-card aria-labelledby="wifi-name">
<header class="top">
<span class="top__dev" data-device>Quillan Hub</span>
<svg class="top__sep" viewBox="0 0 8 12" aria-hidden="true"><path d="M2 1.5 6 6l-4 4.5"></path></svg>
<span class="top__page">Network</span>
</header>
<div class="row">
<span class="tile" data-tile aria-hidden="true">
<span class="tile__ring" data-ring></span>
<svg class="wifi" viewBox="0 0 32 32">
<path class="wifi__arc" data-arc d="M4.69 13.69 A16 16 0 0 1 27.31 13.69"></path>
<path class="wifi__arc" data-arc d="M8.22 17.22 A11 11 0 0 1 23.78 17.22"></path>
<path class="wifi__arc" data-arc d="M11.76 20.76 A6 6 0 0 1 20.24 20.76"></path>
<circle class="wifi__dot" data-arc cx="16" cy="25" r="2.3"></circle>
</svg>
</span>
<div class="row__text">
<label class="row__name" id="wifi-name" for="wifi-switch">Wi-Fi</label>
<span class="status" aria-live="polite"><span class="status__t" data-status>Off</span></span>
</div>
<button class="switch" id="wifi-switch" type="button" role="switch" aria-checked="false" data-switch>
<span class="switch__knob" data-knob></span>
</button>
</div>
<p class="hint" data-hint><span class="hint__t">Turn on Wi-Fi to see the networks nearby.</span></p>
<div class="list" data-list>
<div class="list__in">
<div class="net net--current" data-current>
<svg class="bars" viewBox="0 0 18 14" aria-hidden="true" data-bars="4">
<rect x="0" y="10" width="3" height="4" rx="1"></rect>
<rect x="5" y="7" width="3" height="7" rx="1"></rect>
<rect x="10" y="4" width="3" height="10" rx="1"></rect>
<rect x="15" y="0" width="3" height="14" rx="1"></rect>
</svg>
<span class="net__text">
<span class="net__name" data-name>Quillan-Home</span>
<span class="net__sub" data-sub>Connected · 5 GHz</span>
</span>
<svg class="net__tick" viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 12.6l4.1 4 8.9-9.2"></path></svg>
</div>
<p class="list__label">Other networks</p>
<button class="net" type="button" data-net tabindex="-1">
<svg class="bars" viewBox="0 0 18 14" aria-hidden="true" data-bars="3">
<rect x="0" y="10" width="3" height="4" rx="1"></rect>
<rect x="5" y="7" width="3" height="7" rx="1"></rect>
<rect x="10" y="4" width="3" height="10" rx="1"></rect>
<rect x="15" y="0" width="3" height="14" rx="1"></rect>
</svg>
<span class="net__text">
<span class="net__name" data-name>Juniper Café</span>
<span class="net__sub" data-sub>Open</span>
</span>
<svg class="net__lock" data-lock viewBox="0 0 12 14" aria-hidden="true"><rect x="1.5" y="6" width="9" height="7" rx="2"></rect><path d="M3.8 6V4.4a2.2 2.2 0 0 1 4.4 0V6"></path></svg>
</button>
<button class="net" type="button" data-net tabindex="-1">
<svg class="bars" viewBox="0 0 18 14" aria-hidden="true" data-bars="2">
<rect x="0" y="10" width="3" height="4" rx="1"></rect>
<rect x="5" y="7" width="3" height="7" rx="1"></rect>
<rect x="10" y="4" width="3" height="10" rx="1"></rect>
<rect x="15" y="0" width="3" height="14" rx="1"></rect>
</svg>
<span class="net__text">
<span class="net__name" data-name>Studio Fern</span>
<span class="net__sub" data-sub>Secured</span>
</span>
<svg class="net__lock" data-lock viewBox="0 0 12 14" aria-hidden="true"><rect x="1.5" y="6" width="9" height="7" rx="2"></rect><path d="M3.8 6V4.4a2.2 2.2 0 0 1 4.4 0V6"></path></svg>
</button>
<button class="net" type="button" data-net tabindex="-1">
<svg class="bars" viewBox="0 0 18 14" aria-hidden="true" data-bars="1">
<rect x="0" y="10" width="3" height="4" rx="1"></rect>
<rect x="5" y="7" width="3" height="7" rx="1"></rect>
<rect x="10" y="4" width="3" height="10" rx="1"></rect>
<rect x="15" y="0" width="3" height="14" rx="1"></rect>
</svg>
<span class="net__text">
<span class="net__name" data-name>Linden Guest</span>
<span class="net__sub" data-sub>Secured</span>
</span>
<svg class="net__lock" data-lock viewBox="0 0 12 14" aria-hidden="true"><rect x="1.5" y="6" width="9" height="7" rx="2"></rect><path d="M3.8 6V4.4a2.2 2.2 0 0 1 4.4 0V6"></path></svg>
</button>
</div>
</div>
</section>
<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.
31 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 bars toggle” from Animorio and fit it into my siteThe knob is a span placed on the left: GSAP only moves its x and width. On press it widens by a few pixels, and as it slides it stretches towards its goal and then pulls back with elastic.out, so it feels like rubber. The track turns blue at the same moment.
The dot and the three arcs use currentColor: GSAP animates the color property of each one, staggered from the centre outwards, in a timeline that repeats until the network answers. A thin ring around the tile widens and fades on every round.
The status line is a one line window with overflow hidden: the old word rises out, the text changes and the new one comes in from below with back.out. Searching…, Connecting to and the network’s name take turns this way.
The list sits in a zero height box: GSAP takes it to height auto on a short spring while the rows arrive from above, staggered. Switching off does the reverse, from the last row, and at the end the networks go back to their order.
Tapping a nearby network lights its bars up in a row like the arcs, then the data of the two rows swap: the texts fade, change and come back with a small bounce, and the tick of the network in use is born again. Every wait goes through gsap.delayedCall, which is cleared when switching off.
| Name | File | Default | What it changes |
|---|---|---|---|
NETWORK | script.js | Quillan-Home | The home network it connects to. |
DEVICE | script.js | Quillan Hub | The device name at the top. |
SEARCH_TIME | script.js | 1.6 | How long it searches before finding the network, in seconds. |
CONNECT_TIME | script.js | 1.1 | How long connecting takes, in seconds. |
KNOB_STRETCH | script.js | 8 | How many pixels the knob stretches while it slides. |
ACCENT | script.js | #2f6bff | The colour of the switch when on and of the arcs. |
For the settings of an app or a connected device (smart home, speakers, printers, cameras), for a product’s setup or for any switch that starts a connection and needs to show the wait.
The card takes the width with a margin and rows, tile and gaps are sized on the height too with clamp and vmin, so the row, the network in use and the three nearby ones fit in the box even with the list open. A tap switches it on like a click.
No springs or waves: the knob goes to its place, the arcs fade to blue, the status changes with a fade and the list opens without a bounce.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 KB; the libraries: GSAP 28 KB.
Tested on 25 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.