Buttons & Toggles
Material Ripple
Dark rounded button that spawns an expanding ink ripple from the tap point; idles by firing ripples from random positions every 1.5 s.
csslight complexitysubtle 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
CTA buttons, action triggers, any click surface needing tactile feedback with a material-design feel.
When not to
Auto-cycling demo ripple must be removed before production use; not suitable where motion is distracting or backgrounds are light.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the ripple color from teal/cyan to gold by editing the radial-gradient in .c04-rip__ink background to rgba(255,180,0,0.55), rgba(255,220,80,0.15), and slow the spread to 800ms via --dur-slow. 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
- ripple color (radial-gradient in .c04-rip__ink)
- ripple spread duration (--dur-slow: 520ms)
- ripple size multiplier (2.2 in JS)
- idle loop interval (1500ms in setTimeout)
- button padding and border-radius (--r-md)
- idle demo cadence (LEAD=400 / DEMO_EVERY=2500 / IDLE_RESUME=3600 ms, TICK=100)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- overflow:hidden on .c04-rip (clips ripple)
- IIFE wrapper
- reduced-motion guard (animation-duration:.001ms + early return in loop)
- visibilitychange pause
- idle demo ripple (the same ripple() a tap runs; real input takes over)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Auto-cycling idle loop must be removed or stopped before shipping in production
- Ripple colour lives in the --ink-a/--ink-b tokens (dark in :root, light in [data-theme=light]) — edit both blocks to restyle
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.
- 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.