Join our Discord Community

React 3-Tap Voronoi Shaders

Ultra-fast 3-tap Voronoi with simplex grid and cheap highlights. Pure WebGL cellular patterns for React with TypeScript and shadcn/ui—optimized GPU Voronoi cells.

Powered by

Building fast Voronoi effects?

Join our Discord community for help from other developers working with WebGL shaders.


Look, we've all tried to build efficient Voronoi patterns. You either end up with expensive 9-tap algorithms that destroy performance or basic square grids that look artificial. This React component uses ultra-fast 3-tap Voronoi with simplex grid setup and directional-derivative highlighting that actually runs at 60fps without melting your CPU.

Ultra-fast Voronoi patterns

Beautiful 3-tap Voronoi cells with sophisticated simplex grids and cheap directional highlights that won't destroy your performance metrics:

Loading component...

Created by Shane in 2015-09-10

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL 3-tap sampling with simplex grid calculations and directional-derivative lighting. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/three-tap-voronoi-shaders.json

Usage

import { ThreeTapVoronoiShaders } from "@/components/ui/three-tap-voronoi-shaders";

export default function Hero() {
  return (
    <ThreeTapVoronoiShaders>
      <div className="relative z-10">
        <h1>Your content here</h1>
      </div>
    </ThreeTapVoronoiShaders>
  );
}

Why most Voronoi implementations suck

Most developers try to create Voronoi patterns with expensive 9-tap algorithms or basic square grids. Bad idea. You're dealing with performance-crushing calculations, artificial-looking patterns, and wondering why your React app crawls. Some use complex distance field operations, which sounds smart until you realize you're computing dozens of samples per pixel.

This React component uses ultra-efficient 3-tap Voronoi with simplex grid setup and directional-derivative highlights. The GPU handles everything using optimized triangle sampling with authentic cellular patterns and cheap lighting effects. No JavaScript calculations, no performance overhead, just smooth 60fps mathematical Voronoi rendering.

Features

  • Zero JavaScript Voronoi overhead - Pure WebGL 3-tap sampling runs on GPU
  • Simplex grid calculations with efficient triangle-based cell determination
  • Directional-derivative highlighting for cheap but effective lighting without bump mapping
  • Multiple color schemes with animated transitions and geometric patterns
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 4 props for complete Voronoi control
  • Performance optimization through minimal sampling algorithms
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing

API Reference

ThreeTapVoronoiShaders

Main container component for the 3-tap Voronoi effect.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
scalenumber1.0Voronoi cell scale factor (0.5 to 3.0)
highlightIntensitynumber1.0Directional highlight intensity (0.1 to 3.0)
colorSchemenumber0Color palette (0: Fire/Bio, 1: Neon, 2: Cool)
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 hash calculations and color mixing. Consider reducing speed and scale props for better performance.

Cells too large/small: Adjust the scale prop to control Voronoi cell size. Lower values create larger cells, higher values create finer cellular detail.

Highlights too harsh/subtle: Use the highlightIntensity prop to control directional lighting. Values around 0.3-0.7 create subtle depth without overexposure.

Colors not changing: The colorScheme prop switches between different palette combinations. Try values 0, 1, or 2 for different aesthetic styles.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask