CSS Toggle / Switch Generator
A real, clickable on/off switch built from one checkbox and CSS -- pill, rounded or square shape, on/off/knob colours, optional icons or text labels, glow, and a real :checked-driven preview (click it!). Presets, randomize, and export to CSS, Tailwind, SCSS or React.
What this tool does
Builds an on/off toggle switch from a single hidden checkbox
and the :checked sibling selector — no JavaScript
needed to flip its state. Clicking the preview here toggles the
real underlying checkbox, so what's demonstrated is exactly the
exported CSS's actual behaviour, not a static mockup pretending
to be interactive.
Shape, colours and sizing
Pill, rounded, or square track shape, independent on/off track colours and a knob colour, adjustable size, and animation duration for how quickly the knob slides across.
Glow and disabled state
An optional glow adds a coloured shadow around the track when switched on, useful for a more prominent active state. A disabled toggle dims the switch and sets the cursor to not-allowed, matching how a real disabled form control should look and behave.
Presets and randomizing
Five presets — iOS Style, Material, Neon, Minimal Square, and Large — cover common looks, plus a randomize button for quick exploration.
Getting it out
Export as plain CSS (with the exact markup structure needed —
a checkbox followed by track and knob spans), a Tailwind snippet
using the peer/peer-checked pattern
(the correct Tailwind idiom, since Tailwind has no plain
:checked + sibling arbitrary variant), SCSS, or
React style objects with a note on toggling state via a class.
Privacy
Everything runs locally in your browser -- nothing you build is sent to a server.