- Docs
- Components
- Interface
- Product Mockups
- Spin Viewer
Spin a 3D product model with a drag, momentum and pinned notes
| Name | Type | Default | Description |
|---|---|---|---|
model | string | a vintage camera | URL of a glTF or GLB model. It is centred, scaled to fit and set on a turntable, so any size or origin works. |
hotspots | { label, description?, position, normal? }[] | three camera notes | Pins fixed to points on the model. position is [x, y, z] in the model's own units. normal is the direction the surface faces, so a pin fades out when it turns away. |
start | number | -32 | Angle in degrees the model faces first. |
reverse | boolean | false | Flips the direction of dragging and turning. |
sensitivity | number | 1 | How far the model turns per pixel dragged. 1 turns it once across the full width. |
inertia | boolean | true | A quick flick keeps it turning and slowing down. |
autoplay | boolean | true | Turns slowly on its own while nobody is touching it. |
autoplaySpeed | number | 22 | Degrees per second while turning on its own. |
resume | number | 2600 | Milliseconds after the last drag before it starts turning on its own again. |
tilt | number | 16 | How far the camera looks down on the model, in degrees. |
zoom | number | 1 | Frames the model closer or further away. |
exposure | number | 1 | Overall brightness of the lighting. |
ring | boolean | true | A turntable of fine ticks around the model, with a dot marking its front. |
shadow | boolean | true | Soft contact shadow under the model. |
hint | string | "Drag to spin" | Small hint shown until the first drag. An empty string hides it. |
aspect | number | 4 / 3 | Width to height ratio of the viewer. |
intro | boolean | true | The model spins into view and settles once it has loaded. |
theme | "auto" | "light" | "dark" | "auto" | Auto matches the ring, pins and cards to the background behind it. |
accentColor | string | text colour | Colour of the pin centres and the ring's front dot. |
inkColor | string | text colour | Colour of the ring ticks and the hint. |
onAngle | (degrees: number) => void | — | Called as the model turns, with its angle from 0 to 359. |
ref | { spinTo, play, pause, reset } | — | Turns the model from your own code. spinTo eases to an angle the short way round. |
className | string | — | Classes for the root element. |
style | CSSProperties | — | Inline styles for the root element. |
modelstringURL of a glTF or GLB model. It is centred, scaled to fit and set on a turntable, so any size or origin works.
a vintage camerahotspots{ label, description?, position, normal? }[]Pins fixed to points on the model. position is [x, y, z] in the model's own units. normal is the direction the surface faces, so a pin fades out when it turns away.
three camera notesstartnumberAngle in degrees the model faces first.
-32reversebooleanFlips the direction of dragging and turning.
falsesensitivitynumberHow far the model turns per pixel dragged. 1 turns it once across the full width.
1inertiabooleanA quick flick keeps it turning and slowing down.
trueautoplaybooleanTurns slowly on its own while nobody is touching it.
trueautoplaySpeednumberDegrees per second while turning on its own.
22resumenumberMilliseconds after the last drag before it starts turning on its own again.
2600tiltnumberHow far the camera looks down on the model, in degrees.
16zoomnumberFrames the model closer or further away.
1exposurenumberOverall brightness of the lighting.
1ringbooleanA turntable of fine ticks around the model, with a dot marking its front.
trueshadowbooleanSoft contact shadow under the model.
truehintstringSmall hint shown until the first drag. An empty string hides it.
"Drag to spin"aspectnumberWidth to height ratio of the viewer.
4 / 3introbooleanThe model spins into view and settles once it has loaded.
truetheme"auto" | "light" | "dark"Auto matches the ring, pins and cards to the background behind it.
"auto"accentColorstringColour of the pin centres and the ring's front dot.
text colourinkColorstringColour of the ring ticks and the hint.
text colouronAngle(degrees: number) => voidCalled as the model turns, with its angle from 0 to 359.
—ref{ spinTo, play, pause, reset }Turns the model from your own code. spinTo eases to an angle the short way round.
—classNamestringClasses for the root element.
—styleCSSPropertiesInline styles for the root element.
—