web3d-integration-patterns

Provides architecture patterns for integrating Three.js, GSAP, React Three Fiber, Motion, and React Spring.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/ayofemiade/cleva --skill web3d-integration-patterns-ayofemiade
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: web3d-integration-patterns
Source: https://github.com/ayofemiade/cleva/tree/main/.claude/skills/web3d-integration-patterns
Command: npx skills add https://github.com/ayofemiade/cleva --skill web3d-integration-patterns-ayofemiade

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building complex 3D web experiences often requires combining multiple rendering and animation libraries, which leads to architecture confusion, animation conflicts, state synchronization bugs, and performance problems. This Skill provides proven integration patterns and decision frameworks for combining Three.js, GSAP ScrollTrigger, React Three Fiber, Motion, and React Spring in a single application. ## Core Features & Use Cases - Architecture Patterns: Four layered patterns covering Three.js + GSAP + React UI separation, unified React Three Fiber components, hybrid R3F + GSAP timelines, and physics-based R3F + React Spring interactions. - State Management Strategies: Zustand-based global 3D state patterns that keep React UI and Three.js scenes synchronized. - Performance Optimization: Cross-library render loop coordination, on-demand rendering with frameloop="demand", and adaptive pixel ratio techniques. - Use Case: When building a scroll-driven product landing page, use the Three.js + GSAP ScrollTrigger pattern to animate camera paths and mesh properties on scroll while keeping React UI overlays decoupled. ## Quick Start Ask the AI to design the architecture for a scroll-driven 3D landing page combining Three.js, GSAP ScrollTrigger, and React UI overlays.

Frequently Asked Questions about web3d-integration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I combine Three.js with GSAP ScrollTrigger for scroll-driven animations?▼

Register the ScrollTrigger plugin, then animate Three.js camera positions, mesh rotations, or material properties inside gsap.to() calls with scrollTrigger configuration using scrub and trigger elements. Initialize the Three.js scene separately and pass its references to the GSAP animation setup.

React Three Fiber vs vanilla Three.js with React, which should I use?▼

React Three Fiber suits React-first architectures needing declarative components and unified state management, while vanilla Three.js with GSAP suits scroll-heavy marketing pages needing imperative control. The decision matrix in this Skill maps use cases to the recommended stack.

Can I use GSAP and React Spring together in the same 3D scene?▼

Yes, but never animate the same property with both libraries simultaneously, as this causes conflicts. Assign each library distinct properties, for example GSAP handles position while React Spring handles scale, or coordinate their timing explicitly.

How do I sync React state with a Three.js scene?▼

Use Zustand for global 3D state shared between the scene and UI components. Update both the Three.js object and the store together, and subscribe components to store slices so selection, camera mode, and animation state stay consistent.

Why do my GSAP animations cause memory leaks in React components?▼

Animations leak when tweens or timelines are not killed on component unmount. Always store the tween reference and call tween.kill() or tl.kill() inside the useEffect cleanup function to dispose of running animations.

How do I improve performance when combining multiple 3D animation libraries?▼

Use on-demand rendering with frameloop="demand" in React Three Fiber and call invalidate() only when state changes. For vanilla Three.js, coordinate a single render loop with a needsRender flag triggered by ScrollTrigger updates, and cap devicePixelRatio at 2.