React Ripple Shaders
React ripple effect with GPU wave interference patterns. Water ripples for Next.js with TypeScript and shadcn/ui—free code.
Powered by
Building water effect animations?
Join our Discord community for help from other developers working with WebGL and wave simulations.
Need realistic water ripple effects without physics engines? Most developers use heavy particle systems or complex wave calculations that destroy performance. This React ripple component uses WebGL fragment shaders for mathematical wave interference patterns.
Copy-paste TypeScript component that creates expanding circular ripples with realistic wave physics. Multiple ripple sources create interference patterns like real water. Built for Next.js applications with shadcn/ui design system. GPU-accelerated—zero CPU animation loops.
React ripple effects with WebGL shaders
Mathematical wave interference with expanding circular ripples and realistic physics:
Original shader by Dov Azencot
Perfect for React 19, Next.js 15, and modern TypeScript projects. Mathematical wave interference rendered entirely on GPU using GLSL fragment shaders. Customizable speed, intensity, colors, and ripple sources. Full shadcn/ui compatibility with Tailwind CSS styling.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/ripple-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/ripple-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/ripple-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/ripple-shaders.json
Usage
import { RippleShaders } from "@/components/ui/ripple-shaders";
export default function WaterBackground() {
return (
<RippleShaders
speed={1.2}
intensity={1.5}
colorScheme={[0.1, 0.5, 1.0]}
rippleCount={4}
frequency={1.0}
>
<div className="relative z-10">
<h1>Content over ripples</h1>
</div>
</RippleShaders>
);
}
Why water animations struggle with realism
CSS animations can't simulate wave physics. JavaScript calculations for multiple ripples kill performance. Most libraries fake water effects with simple scaling transforms that look artificial.
WebGL fragment shaders solve this with real mathematical wave interference. Each pixel calculates distance from multiple ripple sources. Sine wave functions create expanding circles. Wave superposition creates realistic interference patterns where ripples intersect.
This React ripple component uses GLSL mathematics for authentic wave behavior. Multiple expanding circles with distance-based attenuation. Wave interference creates the complex patterns you see in real water.
React ripple shader features
- WebGL wave physics - Mathematical sine wave interference patterns on GPU
- Multiple ripple sources - Configurable number of expanding circular waves
- Wave interference - Realistic patterns where ripples intersect and combine
- Distance attenuation - Waves fade naturally with distance from source
- Circular motion - Ripple sources move in orbital patterns for dynamic effects
- Color scheme control - RGB customization for different water themes
- Frequency adjustment - Wave density and tightness controls
- TypeScript React component - Full IDE support with prop definitions
- Next.js compatible - Works with App Router and modern React patterns
- shadcn/ui integration - Consistent with Tailwind CSS design systems
- Copy-paste installation - No vendor lock-in, you own the shader code
- Mobile optimized - Efficient GPU usage for smooth mobile performance
API Reference
RippleShaders
Main container component for the dynamic ripple shader effect.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Animation speed multiplier (0.1 to 3.0) |
intensity | number | 1.0 | Ripple brightness and contrast (0.1 to 3.0) |
colorScheme | [number, number, number] | [0.2, 0.6, 1.0] | RGB color scheme for water theme |
rippleCount | number | 3 | Number of ripple sources (1 to 5) |
frequency | number | 1.0 | Wave frequency multiplier (0.5 to 2.0) |
className | string | - | Additional Tailwind CSS classes |
...props | HTMLAttributes<HTMLDivElement> | - | All standard div props |
WebGL ripple troubleshooting
Ripples too faint: Increase intensity
to 2.0+ for more visible waves. Fragment shaders use different brightness scales than CSS animations.
Animation too chaotic: Multiple ripple sources can overwhelm. Reduce rippleCount
to 2-3 for calmer effects, or lower frequency
to 0.7 for gentler waves.
Mobile performance issues: GPU-intensive shaders need optimization. Lower intensity
to 1.0 and rippleCount
to 3 on mobile devices. Consider device detection for automatic adjustments.
Wrong water colors: colorScheme
uses 0-1 range for realistic water colors. Try [0.0, 0.3, 0.8]
for deep blue water, [0.1, 0.6, 0.4]
for tropical aqua.
Ripples too tight/loose: Adjust frequency
to control wave density. Lower values (0.5) create loose, slow waves. Higher values (1.5) create tight, rapid ripples.
WebGL compatibility: Wave interference requires decent GPU. Provide CSS radial gradient fallbacks for older devices with limited WebGL support.
More React shader components
Explore other GPU-accelerated components for Next.js applications:
Kaleidoscope Shaders
Dynamic animated kaleidoscope with rotating layers and wave synthesis
Plasma Shaders
Organic energy effects with flowing plasma patterns and smooth color cycling
Nebula Shaders
Procedural cosmic clouds with fractal structures and animated star fields
Matrix Shaders
Authentic digital rain with procedural characters and cyberpunk green effects
Aurora Shaders
Flowing northern lights with fractal noise patterns and atmospheric colors
Cosmic Waves Shaders
Flowing cosmic ocean patterns with multi-layer waves and starfields
Digital Tunnel Shaders
Infinite 3D tunnel with neon rings and particle flows using raymarching
Glitch Shaders
Digital corruption effects with chromatic aberration and cyberpunk glitch
Hologram Shaders
Sci-fi holographic effects with interference patterns and chromatic aberration
React ripple shader FAQ
React Raymarching Shaders
Hypnotic 3D raymarching effects with ACES tonemapping and dot noise. Pure WebGL shaders for React with TypeScript and shadcn/ui—smooth GPU animations.
Ripples in Black Shaders
Colorful plasma-style ripple effects with dynamic interference patterns. Three moving points create mesmerizing sine-based ripples with color transitions and psychedelic visuals.