Join our Discord Community

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.

Powered by

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:

Loading component...

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.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
rippleFrequencynumber1.0Sine wave frequency multiplier (0.1 to 3.0)
colorIntensitynumber1.0Color saturation and brightness (0.1 to 2.0)
interferenceThresholdnumber0.5Threshold for color/monochrome switching (0.0-1.0)
classNamestring-Additional Tailwind CSS classes
...propsHTMLAttributes<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:

Questions developers actually ask