Skip to content
animorio
IT
All components

Wi-Fi bars toggle

Toggles, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.8 KBGSAP 28 KBFreeDownload the zip

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.

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

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.

31 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 “Wi-Fi bars toggle” 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 very light grey background there is a white card with, at the top, the settings path of an invented device, Quillan Hub, and the Wi-Fi row: a small tile with the drawn icon, three arcs and the dot, the word Wi-Fi with the status in grey below and the switch. Pressed, the knob stretches; then it slides on a spring and the track turns blue. The arcs light up one after another from the centre outwards, in waves, with a thin ring widening around the icon, and the status says Searching…, then Connecting to Quillan-Home: the words rise and make way for the new ones. Once connected the tile turns blue with white arcs and gives a little hop; below, the list of networks drops in: the one in use with blue bars, Connected · 5 GHz and a drawn tick, and the other networks nearby with their bars, each weaker than the last, and a drawn lock on the secured ones. Tapping a nearby network makes its bars search, the line says Joining… and then that network takes the place of the one in use. Switching off puts the arcs out from the outside towards the centre and the list closes. A drawn pointer switches it on, waits for the connection, joins the café’s network and switches off, then starts again; it also really works, with mouse, touch and keyboard.

How it works

A knob that stretches

The 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.

Arcs that search

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 that rises

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 that drops

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.

Changing network

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.

Values to change

NameFileDefaultWhat it changes
NETWORKscript.jsQuillan-HomeThe home network it connects to.
DEVICEscript.jsQuillan HubThe device name at the top.
SEARCH_TIMEscript.js1.6How long it searches before finding the network, in seconds.
CONNECT_TIMEscript.js1.1How long connecting takes, in seconds.
KNOB_STRETCHscript.js8How many pixels the knob stretches while it slides.
ACCENTscript.js#2f6bffThe colour of the switch when on and of the arcs.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • GSAP writes its own inline transform: the knob must not have a transform in the CSS, or it gets wiped. It is placed with left and top and GSAP only moves its x and width.
  • The connection waits go into gsap.delayedCall, not setTimeout: switching off halfway through the search clears them all, otherwise the list would open with the switch off.
  • The fake pointer’s hover does not use :hover: an is-hover class is added, and the real :hover sits inside @media (hover: hover) so it does not stay on after a tap on iPhone.

Libraries

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.

Testing

Tested on 25 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