Hover✨ Premium

Ripple Click

A Material Design button: on click, a circular wave ripples out from the exact point of contact, expands, and fades out. Three visual variants (violet, outline, dark), minimal JavaScript.

CSSJSMaterial

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Hover has 48 effects, including 5 free. Explore the category →

3 usage examples

Action buttons in a support ticket management app — internal tool of a large retail IT department — Ripple Click example 1

① Action buttons in a support ticket management app — internal tool of a large retail IT department

WhenAssign, Resolve, Escalate buttons on ticket cards; each button emits a radial wave on click confirming the action without a page reload. 120×40 px buttons.
WhyThe Material ripple is the standard tactile feedback of native apps; it reassures the operator that the click was registered even if the network request is slow.
SettingsOutline variant on a dark list background, violet wave, short labels in 14 px sans-serif.
Electronic signature button for a service contract — client portal of a labor-law consultancy — Ripple Click example 2

② Electronic signature button for a service contract — client portal of a labor-law consultancy

WhenI sign and agree button (dark variant, 260×56 px); the radial wave visually confirms the contractual act.
WhyA radial wave on a signing action gives a solemn, deliberate character to the click — turning it into an act.
SettingsDark variant (mi-ripple-btn--dark), 260×56 px, white wave, 18 px text.
Triggering an alert in an industrial monitoring dashboard — SCADA interface of a water treatment plant — Ripple Click example 3

③ Triggering an alert in an industrial monitoring dashboard — SCADA interface of a water treatment plant

WhenTrigger level-2 alert button (outline variant); the radial wave informs the operator the action was registered.
WhyA strong, localized visual feedback on the alert button reduces the risk of repeated pressing out of doubt during an emergency.
SettingsOutline variant with red alert border, 180×48 px, semi-transparent red wave.

How it works

The .fx-0364-root root (250 px tall, rgb(26, 26, 36) background) centers three .mi-ripple-btn buttons in .mi-ripple-scene. Each button carries the data-ripple attribute, which signals to the script that it should receive the effect. The buttons have position: relative; overflow: hidden — that overflow: hidden is what keeps the wave inside the button area.

On click, the script computes the pointer position within the button via getBoundingClientRect() and creates an absolutely positioned span.mi-ripple. Its size is twice the button’s largest dimension (to cover the corners), its center aligns with the click point, and it animates via @keyframes miRippleOut: scale from 0 to 1 over 0.6 s with ease-out and opacity from 0.3 to 0 over the same duration. At the end of the animation, the span is removed from the DOM to prevent accumulation.

Three CSS variants change only the colors: .mi-ripple-btn--purple (violet background #6366f1, white wave), .mi-ripple-btn--outline (transparent background, violet border, violet wave), .mi-ripple-btn--dark (dark background #1e1b4b, white wave). The HTML structure and animation are identical for all three. The script detects prefers-reduced-motion: if enabled, no span is created and the wave does not play.

Accessibility

  • Keyboard: each button is a real <button>; Tab reaches it, Space or Enter fires it. The focus outline (:focus-visible) appears on keyboard navigation only.
  • Reduced motion: under prefers-reduced-motion: reduce, the JavaScript creates no wave span and the CSS removes the wave animation. The buttons remain fully functional visually (colors, hover, focus) with no animated elements.
  • Touch: the wave originates from the touch point on a touchscreen (via the click event which reports finger coordinates). The minimum 44×44 px click target is met for each variant.

Browser compatibility

CSS (overflow: hidden, @keyframes animations) + 0.6 KB of JavaScript (getBoundingClientRect, createElement, addEventListener, matchMedia), no dependency. Verified in Chromium 151: wave at click point, span removal at animation end, three variants, reduced-motion with no wave, 0 errors. The preview captures show the animation auto-replayed by the scene code: this behaviour is not included in the sold code.

Chrome 49+✓ Full (measured)
Firefox 55+✓ Full
Safari 9+✓ Full
Edge 79+✓ Full (Chromium engine)
Mobile iOS 9+✓ Full
Android Chrome 49+✓ Full (Chromium engine)

Without JavaScript, buttons are clickable and visually correct (hover, focus) but the wave does not appear. Without CSS animations, the span created by the JS stays visible until removal with no animation.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0364-root">
  <div class="mi-ripple-scene">
    <button class="mi-ripple-btn mi-ripple-btn--purple" data-ripple="">Label</button>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Color variant (HTML — modifier class on .mi-ripple-btn) 3 variants: --purple, --outline, --dark Create a new variant in CSS by overriding background, color, border, and the .mi-ripple color. No JavaScript changes needed.
Wave duration and easing (CSS — duration and easing of @keyframes miRippleOut) 0.6 s, ease-out Reduce to 0.3 s for a crisp, discreet wave; raise to 1 s for a slow, contemplative one. ease-in gives a slow start and fast end.
Maximum wave opacity (CSS — starting opacity value in @keyframes miRippleOut) 0.3 0.15 is very subtle; 0.5 is more visible. On the outline variant, the violet wave at 0.3 is already clearly legible on a light background.
Activation on any element (HTML — data-ripple attribute) On the three demo buttons Add data-ripple to any focusable element (<a>, <button>) in the same root. Make sure the element has position: relative; overflow: hidden.

FAQ

Yes. Each click creates a new independent wave span. Multiple waves can coexist simultaneously on the same button, each originating from its corresponding click point. Each span is removed from the DOM at the end of its own animation.
No. overflow: hidden on the button contains the wave within its bounds. This is essential to keep the effect clean; do not remove this property.
Yes. The click event fired by a touch reports the contact point coordinates. The wave originates at the finger, not the button center. Tested in Chromium (touch emulation); identical behavior expected on real devices.