Buttons & Toggles
Gooey Liquid Toggle
Pill toggle where an SVG goo-filtered blob stretches and merges as it slides from off to on, shifting grey to magenta. Auto-cycles as demo.
svglight complexitymoderate motionclick
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Settings pages, dark-mode switches, any boolean UI control that benefits from tactile, liquid feel.
When not to
Forms requiring immediate user control — remove the auto-cycle loop and wire state management before shipping in production.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change accent color to emerald (#22c55e), slow the toggle travel by setting --dur-base to 420ms, and increase the drop trail offset from 20 to 32. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- accent color (--accent-iris: #DA3E8C)
- transition duration (--dur-base: 280ms)
- knob size (r: 17px on lead blob)
- drop trail offset (offX+20 / onX-20)
- idle demo cadence (ON_MS=1700 on / OFF_MS=2500 off, first flip after 400 ms)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- SVG goo filter (feGaussianBlur + feColorMatrix)
- IIFE wrapper
- prefers-reduced-motion guard
- aria-pressed attribute on button
- idle demo cycle + takeover() on real click (setInterval driver, resumes after IDLE_RESUME)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Idle demo cycle runs by default (real input takes over, resumes after a few idle seconds) — remove the demo block for purely on-demand interaction
More Buttons & Toggles components
- Magnetic ButtonDark pill button drifts in an idle orbital float; cursor proximity pulls it magnetically with a label inner-parallax and emerald-to-copper glow on hover.
- Morphing Action FABGradient FAB whose plus icon rotates 135° to an X on click, fanning six icon buttons outward in a staggered radial spring animation. Auto-cycles in demo mode.
- Material RippleDark rounded button that spawns an expanding ink ripple from the tap point; idles by firing ripples from random positions every 1.5 s.
- Neon Glow PulseAmber pill button on near-black that breathes a bright neon bloom via opacity pulse on a pseudo-element; hover shifts background and text color.
- Jelly PressAurora-gradient button squashes and stretches with a spring keyframe animation on click; auto-cycles idle squish every 2.1s to stay alive at rest.
- Stroke-Draw OutlineGhost button whose rounded-rect SVG border self-draws via stroke-dashoffset on hover; an idle loop auto-cycles draw/erase every ~2s.