Docs/Image Ripple Effect

Image Ripple Effect

A WebGL image ripple component powered by React Three Fiber. Cursor movement paints displacement waves that refract image cards in real time.

Installation

$pnpm dlx shadcn@latest add @componentry/image-ripple-effect

Usage

Brush Asset Note: This component works without any extra file using its built-in radial brush. If you setbrushTextureUrl="/brush.png", then your project must include that file underpublic/brush.png.

Download brush.png

API Reference

PropTypeDefault
imagesImage descriptors. Each item accepts src, x, y, widthScale and heightScale.
RippleImageItem[]gradient demo images
brushTextureUrlBrush texture used for displacement stamps.
stringgenerated radial brush
distortionStrengthHow strongly waves distort sampled image UVs.
number0.075
waveCountPool size for simultaneous ripple waves.
number100
waveSizeBase wave stamp plane size.
number48
waveRotationSpeedPer-frame rotation speed of each visible wave.
number0.025
waveFadeMultiplierOpacity multiplier applied per frame (lower fades faster).
number0.95
waveGrowthHow fast each wave expands while fading.
number0.155
waveSpawnThresholdMinimum pointer delta required to spawn a new ripple.
number0.1
classNameAdditional classes for the root container.
string—
childrenOptional overlay content rendered above the canvas.
ReactNode—

Click on the icon in the top right of the example preview to view the source code for specific variants.

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Have any questions?
Contact on@harshjdhv
import { ImageRippleEffect } from "@/components/ui/image-ripple-effect"

const images = [
  { src: "/images/picture.jpg", x: 0, y: 0, widthScale: 0.34, heightScale: 0.42 },
]

<ImageRippleEffect
  images={images}
/>