3dscroll
v1.0.8
Published
A scroll-based 3D animation component for React.
Maintainers
Readme
3dscroll
📹 Watch the tutorial → x.com/DieselSharma/status/1949003509309080062
A plug-and-play React + Three.js scroll animation component for 3D .glb models.
✨ Features
- 🚀 Scroll-based 3D transitions
- 🎯 Animate position, rotation, scale, and opacity
- ⚙️ Fully customizable with
phasesarray - 🧩 Built with
three,@react-three/fiber,@react-three/drei, andgsap
📦 Installation
npm install 3dscroll🚀 Usage
"use client";
import { ThreeScene } from "3dscroll";
export default function App() {
const phases = [
{ position: [0, 0, -15], rotation: [0, 0, 0], scale: 1, opacity: 1 },
{ position: [0, 5, -15], rotation: [0, 0, 0], scale: 1.5, opacity: 0.5 },
{ position: [0, 0, -15], rotation: [0, 0, 0], scale: 2, opacity: 0.2 },
{ position: [0, 5, -15], rotation: [0, 0, 0], scale: 1, opacity: 1 },
];
return (
<div style={{ background: "black", minHeight: "100vh" }}>
<ThreeScene
modelPath="/model.glb"
phases={phases}
phaseSize={2} // optional, default is 2
/>
</div>
);
}📁 Props
| Prop | Type | Description |
|-------------|----------|-----------------------------------------------------------|
| modelPath | string | Path to your .glb model (must be placed in public/) |
| phases | array | Animation steps for position, rotation, scale, opacity |
| phaseSize | number | Scroll height multiplier per phase (default = 2) |
🔧 Built With
three@react-three/fiber@react-three/dreigsapreact,typescript, androllupfor bundling
🧠 Author
Made with ❤️ by @3diesel
Follow on Twitter/X
