TOGGLE free pack · 11 switches

11 toggle switches.
Every one a tiny world.

The switches from the reel, running live right here. Each one is a single web component: one file, no dependencies, works in any site or framework. Click one, copy its code, or take all eleven.

How to use one

Every switch works the same way, so you can swap one for another by changing a single tag.

01

Add the file

Download a toggle (or copy its code into symbiote.js) and load it with <script type="module">.

02

Drop in the tag

Put <tg-symbiote> anywhere and give it a size. It scales to fit its box.

03

Listen for changes

Read .checked, call .toggle(), or listen for the change event. React, Vue and Svelte all work.

The 11 toggles

In the order of the reel. Each one has its own middle act, so try flipping it mid-way too.

Click the switch
01 / 11

Symbiote

Black goo reaches across the track, drags the knob over and swallows the switch.

Download symbiote.js 22 KB · no dependencies
How to use it
<script type="module" src="symbiote.js"></script>

<tg-symbiote style="display:block; width:360px; height:220px"></tg-symbiote>

<script type="module">
  const t = document.querySelector("tg-symbiote");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
02 / 11

Snow Globe

A pixel cottage in a glass globe. The marble rolls through golden hour into night, and back through dawn.

Download snowglobe.js 26 KB · no dependencies
How to use it
<script type="module" src="snowglobe.js"></script>

<tg-snowglobe style="display:block; width:360px; height:220px"></tg-snowglobe>

<script type="module">
  const t = document.querySelector("tg-snowglobe");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
03 / 11

Mercury

Liquid metal. The knob stretches into a bridge across the track, then pulls itself together on the other side.

Download mercury.js 22 KB · no dependencies
How to use it
<script type="module" src="mercury.js"></script>

<tg-mercury style="display:block; width:360px; height:220px"></tg-mercury>

<script type="module">
  const t = document.querySelector("tg-mercury");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
04 / 11

Dot Matrix

A dot-matrix moon breaks apart, passes a sunset horizon and re-forms as a sun.

Download dotmatrix.js 20 KB · no dependencies
How to use it
<script type="module" src="dotmatrix.js"></script>

<tg-dotmatrix style="display:block; width:360px; height:220px"></tg-dotmatrix>

<script type="module">
  const t = document.querySelector("tg-dotmatrix");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
05 / 11

Boulder Run

A movie in a toggle. Flip it and the explorer outruns the boulder. Flip it back for the sequel.

Download boulder.js 36 KB · no dependencies
How to use it
<script type="module" src="boulder.js"></script>

<tg-boulder style="display:block; width:360px; height:220px"></tg-boulder>

<script type="module">
  const t = document.querySelector("tg-boulder");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
06 / 11

Tide

A wave rolls through the track, the bubble surfs it and a fish leaps out.

Download tide.js 27 KB · no dependencies
How to use it
<script type="module" src="tide.js"></script>

<tg-tide style="display:block; width:360px; height:220px"></tg-tide>

<script type="module">
  const t = document.querySelector("tg-tide");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
07 / 11

Neon Sign

Glass tubes buzz, the current runs from blue to pink and the knob catches the light.

Download neon.js 20 KB · no dependencies
How to use it
<script type="module" src="neon.js"></script>

<tg-neon style="display:block; width:360px; height:220px"></tg-neon>

<script type="module">
  const t = document.querySelector("tg-neon");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
08 / 11

Arc Reactor

Armour plates open and the core charges through amber to full power.

Download arcreactor.js 32 KB · no dependencies
How to use it
<script type="module" src="arcreactor.js"></script>

<tg-arcreactor style="display:block; width:360px; height:220px"></tg-arcreactor>

<script type="module">
  const t = document.querySelector("tg-arcreactor");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
09 / 11

Origami

The paper disc unfolds into a crane, flies across and folds back up.

Download origami.js 24 KB · no dependencies
How to use it
<script type="module" src="origami.js"></script>

<tg-origami style="display:block; width:360px; height:220px"></tg-origami>

<script type="module">
  const t = document.querySelector("tg-origami");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
10 / 11

Eclipse

The moon slides over the sun: twilight, totality, then the corona flares.

Download eclipse.js 26 KB · no dependencies
How to use it
<script type="module" src="eclipse.js"></script>

<tg-eclipse style="display:block; width:360px; height:220px"></tg-eclipse>

<script type="module">
  const t = document.querySelector("tg-eclipse");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>
Click the switch
11 / 11

Sleepy Blob

A clay blob yawns, stretches its tiny arms and wakes up. Switch it off and it nods back to sleep.

Download blob.js 23 KB · no dependencies
How to use it
<script type="module" src="blob.js"></script>

<tg-blob style="display:block; width:360px; height:220px"></tg-blob>

<script type="module">
  const t = document.querySelector("tg-blob");
  t.addEventListener("change", (e) => console.log("on?", e.detail.checked));
  // t.checked = true;  t.toggle();
</script>