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.
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:
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.
Prop | Type | Default | Description |
---|---|---|---|
speed | number | 1.0 | Animation speed multiplier (0.1 to 3.0) |
transformSpeed | number | 1.0 | Mobius transformation speed (0.1 to 3.0) |
fractalDepth | number | 4.0 | Sierpinski carpet recursion depth (1.0 to 8.0) |
colorIntensity | number | 1.0 | Pattern brightness and intensity (0.1 to 2.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 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:
Abstract Mod Shaders
3D abstract raymarching with procedural geometry
Raymarching Shaders
Advanced 3D tunnel effects with ACES tonemapping
Biomine Shaders
Organic biomine tunnel with gyroid surfaces
Sphere Field Shaders
3D sphere field raymarching with organic distortion
Smooth Voronoi Contours
Mathematical Voronoi patterns with smooth interpolation
Three Tap Voronoi
Advanced Voronoi tessellation with multi-tap sampling
Questions developers actually ask
Minimal Jigsaw Shaders
Elegant jigsaw puzzle patterns with minimal code complexity. Optimized diagonal partitioning algorithm creating authentic puzzle piece aesthetics with efficient GPU rendering.
React Monster Tunnel Shaders
Hypnotic 3D monster tunnel with raymarching and fractal geometry. Pure WebGL shaders for React with TypeScript and shadcn/ui—smooth GPU animations.