Join our Discord Community

React Poincare Disc Animation

Animated hyperbolic Poincare disc tiling with CSG polygons and geometric patterns. Pure WebGL hyperbolic geometry for React with TypeScript and shadcn/ui—mathematical visualization meets performance.

Powered by

Building hyperbolic geometry effects?

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


Creating animated hyperbolic tilings requires deep understanding of non-Euclidean geometry and complex mathematical transformations. This React component uses CSG polygon-driven Poincare disc tiling with animated pattern overlays, hyperbolic reflections, and circle inversion mathematics to create mesmerizing geometric animations that showcase the beauty of hyperbolic space.

Hyperbolic geometric animation

Beautiful Poincare disc tiling with animated geometric patterns and hyperbolic transformations:

Loading component...

Created by Shane in 2023-12-11

Built for React applications with TypeScript and Next.js in mind. The animation runs entirely on the GPU using WebGL with hyperbolic geometry mathematics, circle inversion operations, and sophisticated polygon tiling algorithms. Works seamlessly with shadcn/ui design systems.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/poincare-disc-animation-shaders.json
npx shadcn@latest add https://www.shadcn.io/registry/poincare-disc-animation-shaders.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/poincare-disc-animation-shaders.json
bunx shadcn@latest add https://www.shadcn.io/registry/poincare-disc-animation-shaders.json

Usage

import { PoincareDiscAnimationShaders } from "@/components/ui/poincare-disc-animation-shaders";

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

Why most hyperbolic implementations fail

Most developers try to create hyperbolic tilings using regular Euclidean transformations or pre-computed meshes. Completely wrong approach. You're missing the fundamental mathematics of non-Euclidean geometry, circle inversion, and Möbius transformations that define hyperbolic space. Basic implementations often produce distorted results or fail to maintain the proper geometric relationships.

This React component uses authentic hyperbolic geometry with circle inversion mathematics, Möbius transformations, and CSG polygon operations. The GPU handles everything using optimized hyperbolic reflection algorithms with proper chirality maintenance and distance field calculations. No Euclidean approximations, no geometric distortions, just pure hyperbolic mathematics at 60fps.

Features

  • Zero geometric approximations - Pure hyperbolic geometry with circle inversion and Möbius transformations
  • CSG polygon-driven tiling using triangle (3-8) and quad (4-6) configurations
  • Animated pattern overlays with hyperbolic-aware movement and direction reversal
  • Mouse interaction support with circle inversion for intuitive navigation
  • TypeScript definitions for proper IDE support in React projects
  • Customizable parameters with 5 props for complete geometric control
  • Performance optimization through efficient GPU-based hyperbolic calculations
  • shadcn/ui compatible for consistent design systems
  • Responsive design with automatic canvas resizing and anti-aliasing

API Reference

PoincareDiscAnimationShaders

Main container component for the Poincare disc animation effect.

PropTypeDefaultDescription
speednumber1.0Animation speed multiplier (0.1 to 3.0)
polygonTypenumber0Polygon type (0: Triangle 3-8, 1: Quad 4-6)
rotationSpeednumber1.0Canvas rotation speed (0.1 to 3.0)
animationScalenumber1.0Animated pattern scale (0.5 to 2.0)
colorIntensitynumber1.0Color variation intensity (0.0 to 2.0)
classNamestring-Additional Tailwind CSS classes
...propsHTMLAttributes<HTMLDivElement>-All standard div props

Common gotchas

Animation not appearing: Hyperbolic transformations require high precision floating-point calculations. Older devices may struggle with the complex mathematics involved.

Performance issues on mobile: Circle inversion and Möbius transformations are computationally intensive. Consider reducing animationScale and speed for better mobile performance.

Mouse interaction not working: The mouse inversion system requires proper coordinate transformation. Ensure the component has sufficient size and isn't clipped by parent containers.

Polygons looking distorted: The shader uses specific mathematical constants for triangle (3-8) and quad (4-6) configurations. Other polygon combinations may not render correctly with current implementation.

Colors too uniform: Increase colorIntensity to enhance the procedural coloring based on hyperbolic reflection count and geometric position.

You might also like

Explore other shader-based background components for React applications:

Questions developers actually ask