Buttons & Toggles
Hold-to-Shatter CTA
Press-and-hold destructive button that vibrates as it charges, then bursts into shards at full charge, with a reconstruct control.
css+canvasmedium complexitymoderate motionclick
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Safe to edit
- Forever Opus tokens on :root (--bg, --surface*, --text*, --border*, --accent) — one lime accent, no gradients
- copy and data values in markup/script
Keep intact
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
- theme hook: ?theme= bootstrap, forever:theme message listener and :root[data-theme="light"] tokens
- IIFE wrapper, visibilitychange sleep, prefers-reduced-motion guard, time-based (dt) animation
Known limitations
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
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.…
- Gooey Liquid TogglePill 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.
- 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; cycles autonomously until first deliberate input idle squish…