Scene

The container component that sets up the 3D canvas, lighting, and controls.

Preview

Usage

tsx
import { Scene, Cube } from "@3d-ui/components"

export function MyScene() {
  return (
    <Scene 
      backgroundColor="#fafafa" 
      environment="studio"
      cameraPosition={[3, 3, 3]}
    >
      <Cube variant="primary" animate />
    </Scene>
  )
}

Props

PropTypeDefaultDescription
controlsbooleantrueEnable orbit controls
shadowsbooleantrueEnable shadow casting
environmentstring | false"studio"Environment preset or false to disable
backgroundColorstring"#f5f5f5"Canvas background color
cameraPosition[x, y, z][3, 3, 3]Initial camera position
contactShadowsbooleantrueEnable contact shadows
ambientIntensitynumber0.5Ambient light intensity