Buttons & Toggles
Jelly Press
Aurora-gradient button squashes and stretches with a spring keyframe animation on click; cycles autonomously until first deliberate input idle squish every 2.1s to stay alive at rest.
csslight complexitymoderate motionclickmobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
CTA buttons, interactive demos, any UI needing tactile press feedback with lively personality.
When not to
Forms where animation distracts from input focus; remove the autonomous preview cycle that stops at first deliberate input before shipping in production.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the button label to 'Get Started', swap the gradient to linear-gradient(135deg,#E8AB30,#C08459), and slow the squish duration to 0.7s. 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
- button label text ('Press me')
- aurora gradient (--grad-aurora)
- squish duration (0.5s)
- autonomous preview cycle that stops at first deliberate input interval (2100ms)
- border-radius (--r-md: 14px)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- void btn.offsetWidth restart trick (forces animation restart)
- IIFE wrapper
- prefers-reduced-motion guard
- visibilitychange stop/start
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- 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
Known limitations
- cycles autonomously until first deliberate input idle squish by default — remove loop() call before production use
- Gradient is CSS background so no direct text contrast check; dark text (#0b0c12) may fail on pale gradient ends
- 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.
- Stroke-Draw OutlineGhost button whose rounded-rect SVG border self-draws via stroke-dashoffset on hover; an autonomous preview cycle that stops at first deliberate input…