Join our Discord Community

React Mobius Sierpinski Shaders

Hypnotic Sierpinski carpet patterns with Mobius transforms and spiral zoom effects. Advanced fractal geometry with GPU-accelerated mathematical visualization for React.

Powered by

Building fractal visualizations?

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


Look, we've all tried to build fractal patterns. You either end up with static geometric shapes that look nothing like proper mathematical art or JavaScript calculations that can't handle complex Sierpinski iterations smoothly. This React component uses advanced Mobius transformations with spiral zoom effects that actually runs at 60fps without melting your CPU.

Hypnotic Mobius Sierpinski animation

Mesmerizing fractal carpet patterns with mathematical transformations that won't destroy your performance metrics:

Loading component...

Created by Shane in 2016-06-24

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL Mobius transforms with Sierpinski carpet generation and spiral zoom effects. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/mobius-sierpinski-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/mobius-sierpinski-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/mobius-sierpinski-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/mobius-sierpinski-shaders.json

Usage

import { MobiusSierpinskiShaders } from "@/components/ui/mobius-sierpinski-shaders";

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

Why most fractal implementations suck

Most developers try to animate fractal patterns with HTML5 canvas or SVG generation. Bad idea. You're dealing with expensive DOM manipulations, complex geometric calculations, and wondering why your React app feels sluggish. Some use JavaScript math libraries with recursive fractal generation, which sounds smart until you realize you're computing Sierpinski iterations for every pixel on every frame.

This React component uses mathematical Mobius transformations with GPU-accelerated Sierpinski carpet generation. The GPU handles everything using optimized fractal mathematics with authentic geometric recursion. No JavaScript calculations, no DOM rendering, just smooth 60fps mathematical art.

Features

  • Zero JavaScript animation overhead - Pure WebGL fractal generation runs on GPU
  • Mobius transformations with complex mathematical spiral zoom effects
  • Sierpinski carpet patterns using recursive geometric subdivision
  • Customizable fractal depth for controlling geometric complexity
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 4 props for complete control
  • Performance optimization through efficient GPU fractal algorithms
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing

API Reference

MobiusSierpinskiShaders

Main container component for the Mobius Sierpinski effect.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
transformSpeednumber1.0Mobius transformation speed (0.1 to 3.0)
fractalDepthnumber4.0Sierpinski carpet recursion depth (1.0 to 8.0)
colorIntensitynumber1.0Pattern brightness and intensity (0.1 to 2.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 fractal calculations. Consider reducing fractalDepth and transformSpeed props for better performance.

Pattern too faint: Increase the colorIntensity prop. Values around 1.5-2.0 work well for brighter, more visible fractal patterns.

Fractal too complex: Lower the fractalDepth prop for simpler patterns with better performance. Values around 2.0-3.0 create cleaner geometric shapes.

Transformation too fast: Lower the transformSpeed prop for more controlled Mobius transformations. Values around 0.5-0.7 work well for smooth mathematical effects.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask