Animated toggle switch components

A toggle is the smallest decision in an interface, which is why it is a good place for character. It still has to behave like a switch: one press, a clear state and full keyboard support.

Diorama is eight toggle switches, each a small scene: a night town whose windows light up, a fish tank, an eclipse, a sleepy blob that wakes, an LED dot matrix, ink spreading on paper, a rain cloud and a sprout that flowers. One engine runs them all with a real role="switch" that works with Space and Enter, click, or dragging the thumb, and every scene draws itself from the same progress, so a half-dragged switch shows a half-finished scene.

Five material packs each open with a switch run by their own physics: a thumb that ploughs through sand (Dune), a soap bubble for a thumb (Lather), a marble that rolls down its groove when the track tips (Marble), frost that grows in from the rim and melts into beads (Rime), and a sewing button that leaves a running stitch behind it (Stitch).

6 packs

What a good one needs

Questions

Do they work on dark and light pages?

Yes. Each switch is designed to read on both.

Does it work in React, Vue and plain HTML?

Yes. Every screen ships as one framework-free core with React, Next.js, Vue, HTML, Tailwind and Motion versions.

How much does it cost?

Diorama: $2, Dune: $2, Lather: $2, Marble: $2, Rime: $2, Stitch: $2. Paid packs are a one-time price for the whole pack.

Which frameworks are included?

React (TypeScript), Next.js App Router, Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion. React, Vue and HTML are each a thin wrapper over one framework-free core, so they look and move the same. The Next.js version is the React component marked as a client component, with an app/page.tsx example. The Tailwind version adds the pack colours as Tailwind theme tokens, so you place, size and recolour it with utility classes. The Motion version wraps it in a motion.div so you can animate it in, out and on scroll with Motion props; the motion inside still runs on its own engine. Most packs need no npm packages; the 3D ones use Three.js.

Can I use it in client and commercial projects?

Yes. Every pack can be used in unlimited personal and commercial projects, including client work. Paid packs cannot be resold or redistributed as a component library, template or UI kit; free packs are open source under the MIT License, so you may share them too.

Related