1.0.1 • Published 9 months ago

r3f-package v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

R3F Package

A reusable React Three Fiber scene component package.

Installation

npm install r3f-package

Usage

import { Canvas } from '@react-three/fiber';
import { Scene3D } from 'r3f-package';

function App() {
  return (
    <Canvas>
      <Scene3D 
        boxColor="#ff0000"
        sphereColor="#0000ff"
        rotationSpeed={1}
        position={[0, 0, 0]}
        scale={1}
        lights={true}
      />
    </Canvas>
  );
}

Props

Scene3D Component

PropTypeDefaultDescription
boxColorstring'#ff0000'Color of the animated box
sphereColorstring'#0000ff'Color of the animated sphere
rotationSpeednumber1Speed of rotation animations
positionx, y, z0, 0, 0Position of the entire scene
scalenumber1Scale of the entire scene
lightsbooleantrueWhether to include default lighting

Features

  • Animated rotating box
  • Floating animated sphere
  • Ground plane
  • Default lighting setup
  • Configurable colors and animations
  • Responsive scaling and positioning

Development

  1. Install dependencies:
npm install
  1. Build the package:
npm run build
  1. For development with hot reload:
npm run dev
1.0.1

9 months ago

1.0.0

9 months ago