Models by Shopify and Eric Chadwick, CC BY 4.0, from the Khronos glTF Sample Assets.
More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
url | URL of the model. Supports glb, gltf, fbx and obj. | ||
width | number | string | 400 | Width of the viewer. |
height | number | string | 400 | Height of the viewer. |
environment | 'studio' | Lighting environment: studio, city, sunset, dawn, warehouse, apartment, lobby, night, park, forest or 'none'. | |
environmentIntensity | Strength of the environment lighting and reflections. | ||
exposure | Overall brightness of the render. | ||
| 'rise' | 'spin' | 'fade' | 'none' | 'rise' | How the model appears once it has loaded. | |
autoRotate | Slowly turns the model while idle. | ||
autoRotateSpeed | 0.4 | Speed of the idle rotation. | |
autoRotateDelay | 2 | Seconds after you let go before the idle rotation eases back in. | |
dragRotate | Drag to turn the model, with momentum when you let go. | ||
turntable | Limits dragging to left and right, like a product turntable. | ||
zoom | Pinch or hold Ctrl or Cmd and scroll to zoom. Plain scrolling still scrolls the page. | ||
minZoom | 0.7 | How far out you can zoom. | |
maxZoom | 2 | How far in you can zoom. | |
hoverTilt | 0.15 | How much the model leans toward the cursor. 0 turns it off. | |
float | 0.3 | Gentle floating above the shadow. 0 turns it off. | |
shadow | Soft contact shadow under the model. | ||
shadowOpacity | 0.45 | Darkness of the shadow. | |
fit | 0.8 | How much of the viewer the model fills. It is framed automatically. | |
offsetX | Moves the model sideways, from -1 to 1. | ||
offsetY | Moves the model up or down, from -1 to 1. | ||
startAngle | -30 | Starting angle around the model, in degrees. | |
tilt | 10 | Starting tilt toward the viewer, in degrees. | |
resetOnDoubleClick | Double click to return to the starting view. | ||
onModelLoaded | () => void | Called once the model has loaded. | |
ref | Ref | Exposes capture(type?), which returns the current frame as an image data URL. | |
| Extra class names for the container. | |||
| Inline styles for the container. |
urlstringURL of the model. Supports glb, gltf, fbx and obj.
widthnumber | stringWidth of the viewer.
400heightnumber | stringHeight of the viewer.
400environmentstringLighting environment: studio, city, sunset, dawn, warehouse, apartment, lobby, night, park, forest or 'none'.
'studio'environmentIntensitynumberStrength of the environment lighting and reflections.
exposurenumberOverall brightness of the render.
intro'rise' | 'spin' | 'fade' | 'none'How the model appears once it has loaded.
'rise'autoRotatebooleanSlowly turns the model while idle.
autoRotateSpeednumberSpeed of the idle rotation.
0.4autoRotateDelaynumberSeconds after you let go before the idle rotation eases back in.
2dragRotatebooleanDrag to turn the model, with momentum when you let go.
turntablebooleanLimits dragging to left and right, like a product turntable.
zoombooleanPinch or hold Ctrl or Cmd and scroll to zoom. Plain scrolling still scrolls the page.
minZoomnumberHow far out you can zoom.
0.7maxZoomnumberHow far in you can zoom.
2hoverTiltnumberHow much the model leans toward the cursor. 0 turns it off.
0.15floatnumberGentle floating above the shadow. 0 turns it off.
0.3shadowbooleanSoft contact shadow under the model.
shadowOpacitynumberDarkness of the shadow.
0.45fitnumberHow much of the viewer the model fills. It is framed automatically.
0.8offsetXnumberMoves the model sideways, from -1 to 1.
offsetYnumberMoves the model up or down, from -1 to 1.
startAnglenumberStarting angle around the model, in degrees.
-30tiltnumberStarting tilt toward the viewer, in degrees.
10resetOnDoubleClickbooleanDouble click to return to the starting view.
onModelLoaded() => voidCalled once the model has loaded.
refRefExposes capture(type?), which returns the current frame as an image data URL.
Extra class names for the container.
Inline styles for the container.
Dependencies
3 required packages
npm install three @react-three/fiber @react-three/drei


