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
| Prop | Type | Default | Description |
|---|---|---|---|
| controls | boolean | true | Enable orbit controls |
| shadows | boolean | true | Enable shadow casting |
| environment | string | false | "studio" | Environment preset or false to disable |
| backgroundColor | string | "#f5f5f5" | Canvas background color |
| cameraPosition | [x, y, z] | [3, 3, 3] | Initial camera position |
| contactShadows | boolean | true | Enable contact shadows |
| ambientIntensity | number | 0.5 | Ambient light intensity |