Join our Discord Community

React Vortex Background

Swirling particle systems that create hypnotic depth and organic movement. Build mesmerizing React vortex effects with simplex noise algorithms, canvas rendering, customizable parameters, and TypeScript support for Next.js applications with shadcn/ui.

Creating hypnotic swirling experiences?

Join our Discord community for help from other developers.


Most particle effects feel artificial. Rigid. Mathematical in the worst way. But nature swirls with organic unpredictability—galaxies spiral, water whirlpools, smoke curls. This React component recreates that natural chaos using simplex noise algorithms that make hundreds of particles dance in mesmerizing, never-repeating patterns.

Organic particle vortex systems

Watch particles swirl with natural, unpredictable movement powered by simplex noise:

Loading component...

Built for React applications with TypeScript and Next.js. Uses HTML5 Canvas with simplex noise algorithms for organic particle movement that never repeats exactly. 700+ particles create depth and complexity while maintaining smooth 60fps performance. Customizable colors, speeds, and densities let you create anything from subtle ambience to hypnotic centerpieces.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/vortex.json
npx shadcn@latest add https://www.shadcn.io/registry/vortex.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/vortex.json
bunx shadcn@latest add https://www.shadcn.io/registry/vortex.json

Usage

import { Vortex } from "@/components/ui/vortex";

export default function CosmicHero() {
  return (
    <div className="h-screen w-full overflow-hidden">
      <Vortex
        backgroundColor="black"
        particleCount={700}
        baseHue={220}
        rangeHue={100}
        baseSpeed={0.0}
        rangeSpeed={1.5}
        className="flex items-center justify-center w-full h-full"
      >
        {/* Your content floats above the vortex */}
        <div className="text-center text-white z-10">
          <h1 className="text-6xl font-bold mb-4">
            Enter the Vortex
          </h1>
          <p className="text-xl opacity-80">
            Where chaos becomes beauty
          </p>
        </div>
      </Vortex>
    </div>
  );
}

Why most particle systems look fake

Most developers use basic math with Math.sin() and Math.cos() for particle movement. It creates perfect circles and predictable patterns that scream "computer generated." Others use random values, but pure randomness looks chaotic, not organic. Some try physics simulations, but they're performance-heavy and still feel mechanical.

This React component uses simplex noise—the algorithm behind natural terrain generation and procedural textures. Each particle follows noise-generated paths that curve and flow like real fluid dynamics. The result is movement that feels alive, organic, never exactly repeating. Canvas rendering with advanced compositing creates glow effects that make particles blend naturally.

Features

  • Simplex noise algorithms creating organic, never-repeating particle movement patterns
  • Advanced particle physics with customizable speed, radius, and movement range parameters
  • Canvas-based rendering using advanced compositing modes for realistic glow effects
  • Dynamic color system supporting HSL-based hue ranges for vibrant color variations
  • High particle density supporting 700+ particles with smooth 60fps performance
  • Content overlay integration allowing text and UI elements to float above the vortex
  • Responsive container adaptation automatically adjusting to window and container changes
  • Framer Motion integration providing smooth entrance and exit animations
  • Performance optimized using requestAnimationFrame and efficient canvas operations
  • TypeScript definitions for all particle parameters and visual customizations
  • shadcn/ui compatible with proper z-index management and theme integration

API Reference

Vortex

Main component for simplex noise-powered particle vortex systems.

PropTypeDefaultDescription
particleCountnumber700Total particles (300-1200 recommended range)
rangeYnumber800Vertical movement boundary in pixels
baseHuenumber220Starting hue value (0-360, 220=blue, 120=green)
rangeHuenumber100Hue variation range from base (creates color spread)
baseSpeednumber0.0Minimum particle speed (0=still, negative=reverse)
rangeSpeednumber1.5Speed variation range (higher=more speed diversity)
baseRadiusnumber1Minimum particle size in pixels
rangeRadiusnumber2Size variation range (creates depth through scaling)
backgroundColorstring"#000020"Canvas background color (hex, rgb, or CSS colors)
classNamestring-Additional CSS classes for the container element
childrenReactNode-Content to overlay above the vortex effect

Simplex Noise Algorithms

The vortex uses multi-dimensional simplex noise for organic movement:

// Noise-based particle movement
const noiseX = simplex.noise3D(x * 0.01, y * 0.01, time * 0.1);
const noiseY = simplex.noise3D(x * 0.01 + 1000, y * 0.01, time * 0.1);

// Natural spiral tendency with noise variation
particle.x += Math.cos(angle) * speed + noiseX * turbulence;
particle.y += Math.sin(angle) * speed + noiseY * turbulence;

Color System Configuration

// Blue cosmic theme (default)
baseHue={220} rangeHue={100} // Blues to purples

// Green nature theme
baseHue={120} rangeHue={60}  // Greens to yellow-greens

// Warm sunset theme
baseHue={30} rangeHue={90}   // Oranges to reds

// Full spectrum rainbow
baseHue={0} rangeHue={360}   // All colors

// Monochrome variations
baseHue={220} rangeHue={20}  // Subtle blue variations

Performance Guidelines

// Subtle ambience (great performance)
particleCount={300} rangeSpeed={1.0}

// Balanced experience (recommended)
particleCount={700} rangeSpeed={1.5} // Default settings

// Dense immersive effect
particleCount={1000} rangeSpeed={2.0}

// Maximum intensity (test on target devices)
particleCount={1200} rangeSpeed={2.5}

Common gotchas

Simplex noise dependency: This component requires the simplex-noise package (~15kb). If you don't use noise elsewhere in your project, consider the bundle size impact.

Canvas performance scaling: Very high particle counts (1000+) can impact performance on older devices. The organic movement calculations are more expensive than simple linear motion.

Color hue mathematics: Hue values wrap around at 360 degrees. A baseHue of 350 with rangeHue of 50 will create colors from red (350°) through purple to blue (40°).

Content layering complexity: The component creates its own positioning context. Overlaid content needs to be properly structured within the Vortex children for correct z-index behavior.

Background color visibility: On light themes, the default dark background might not match your design. Always set backgroundColor to match your theme.

Mobile device considerations: The complex noise calculations can drain battery faster on mobile. Consider reducing particleCount or rangeSpeed for mobile users.

You might also like

Explore other organic and hypnotic background components for React applications:

Questions developers actually ask