GodUI

Liquid Image

A premium hover effect that ripples and distorts an image like liquid, intensifying with cursor speed.

Hover an image and it distorts like the surface of water — the ripple ramps in, follows your cursor speed, and settles with a damped wave when you leave. Hover the images below.

Mountain landscape
River valley
Waterfall

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/liquid-image.json"

LiquidImage distorts the image with an SVG feTurbulence + feDisplacementMap filter — supported in every modern browser. The displacement scale is eased toward its target in a single requestAnimationFrame loop and written straight to the filter, so the image itself never re-renders. Cursor velocity intensifies the ripple; leaving the image lets it settle back with a damped wave.

Usage

tsx
 
import { LiquidImage } from "@/components/godui/liquid-image";
tsx
 
<LiquidImage src="/photo.jpg" alt="Mountain" className="aspect-square" />

Always on

Set trigger="always" for a continuously breathing ripple, independent of hover.

tsx
 
<LiquidImage src="/photo.jpg" alt="Mountain" trigger="always" />

Tuning the ripple

strength is the peak displacement in pixels; frequency controls the ripple scale — smaller is larger and smoother.

tsx
 
<LiquidImage src="/photo.jpg" alt="Mountain" strength={40} frequency={0.008} />

Accessibility & fallback

When prefers-reduced-motion is set — or if SVG filter: url() is unavailable — LiquidImage falls back to a gentle CSS scale-and-brighten on hover, so the component degrades cleanly. Always pass a meaningful alt.

Props

PropTypeDefaultDescription
srcstringImage source.
altstringAccessible description of the image.
strengthnumber28Peak ripple displacement on interaction, in px.
frequencynumber0.012Turbulence frequency — smaller gives larger, smoother ripples.
trigger"hover" | "always""hover"When the ripple is active.
imgClassNamestringClasses for the inner <img> (sizing, aspect, object-fit).

LiquidImage also forwards every standard <div> attribute to the root element.

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub