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.
Building plasma effects?
Join our Discord community for help from other developers working with dynamic visual effects.
Look, we've all tried to build ripple effects. You either end up with basic CSS animations that look nothing like proper plasma patterns or JavaScript calculations that can't handle complex interference smoothly. This React component uses mathematical sine-wave ripples with dynamic color switching that actually runs at 60fps without melting your CPU.
Hypnotic ripple interference animation
Mesmerizing plasma patterns with three moving points creating colorful interference and dynamic transitions:
Created by DwayneBrah in 2023-01-14
Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL sine-wave calculations with distance field ripples and interference pattern switching. Works seamlessly with shadcn/ui design systems.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/ripples-in-black-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/ripples-in-black-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/ripples-in-black-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/ripples-in-black-shaders.json
Usage
import { RipplesInBlackShaders } from "@/components/ui/ripples-in-black-shaders";
export default function Hero() {
return (
<RipplesInBlackShaders>
<div className="relative z-10">
<h1>Your content here</h1>
</div>
</RipplesInBlackShaders>
);
}
Why most ripple implementations suck
Most developers try to create ripple effects with CSS keyframes or Canvas API drawing. Bad idea. You're dealing with expensive DOM animations, limited wave calculations, and wondering why your React app feels sluggish. Some use SVG filters with animated transforms, which sounds smart until you realize you're computing interference patterns for every element on every frame.
This React component uses mathematical sine-wave calculations with GPU-accelerated distance field rendering. The GPU handles everything using optimized trigonometric functions with authentic plasma mathematics. No JavaScript calculations, no DOM rendering, just smooth 60fps ripple art.
Features
- Zero JavaScript animation overhead - Pure WebGL sine calculations run on GPU
- Three moving wave sources creating complex interference patterns
- Dynamic color switching between colorful rings and monochrome based on intensity
- Aspect ratio correction ensuring perfect circles regardless of screen size
- TypeScript definitions for proper IDE support in React projects
- Customizable parameters with 4 props for complete control
- Performance optimization through efficient GPU trigonometric calculations
- shadcn/ui compatible for consistent design systems
- Responsive design with automatic canvas resizing
API Reference
RipplesInBlackShaders
Main container component for the ripple plasma effect.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Animation speed multiplier (0.1 to 3.0) |
rippleFrequency | number | 1.0 | Sine wave frequency multiplier (0.1 to 3.0) |
colorIntensity | number | 1.0 | Color saturation and brightness (0.1 to 2.0) |
interferenceThreshold | number | 0.5 | Threshold for color/monochrome switching (0.0-1.0) |
className | string | - | Additional Tailwind CSS classes |
...props | HTMLAttributes<HTMLDivElement> | - | All standard div props |
Common gotchas
Animation not working: WebGL might not be supported in the browser. The component logs warnings when WebGL initialization fails. Check browser compatibility.
Performance issues on mobile: Some older phones struggle with complex sine calculations. Consider reducing rippleFrequency and speed for better performance.
Colors too dim: Increase the colorIntensity
prop for more vibrant ripple patterns. Values around 1.5-2.0 work well for bright, saturated colors.
Ripples too fast: Lower the rippleFrequency
prop for slower wave propagation. Values around 0.5-0.7 create more contemplative ripple movement.
Animation too fast: Lower the speed
prop for more controlled point movement. Values around 0.3-0.5 work well for subtle plasma flow.
You might also like
Explore other shader-based background components for React applications:
Abstract Mod Shaders
3D abstract raymarching with procedural geometry
Smooth Voronoi Contours
Mathematical Voronoi patterns with smooth interpolation
Cellular Tiled Tunnel
Organic cellular patterns with tunnel effects
Biomine Shaders
Organic biomine tunnel with gyroid surfaces
Sphere Field Shaders
3D sphere field raymarching with organic distortion
Starry Planes Shaders
Cosmic starfield with layered plane effects