Skip to content
PixiKit

Model Stage

A 3D model viewer for glb, gltf, fbx and obj files. It frames and lights the model, turns it slowly, leans it toward the cursor, floats it over a soft shadow, and lets you drag with momentum, zoom and double click to reset.

pixikit.com/docs/components/model-stage

Customize

Width400px
Height400px
Environment
Environment intensity1.00
Exposure1.00
Intro
Auto rotate
Auto rotate speed0.40
Auto rotate delay2.0s
Drag rotate
Turntable
Zoom
Min zoom0.70
Max zoom2.0
Hover tilt0.15
Float0.30
Shadow
Shadow opacity0.45
Fit0.80
Offset x0.00
Offset y0.00
Start angle-35°
Tilt12°
Reset on double click
Background color

Props

31
NameTypeDefaultDescription
urlstring""The model file: glb, gltf, fbx or obj. Leave empty for a built-in torus knot.
widthnumber | string400The width of the viewer; a number is px. It never grows past its container.
heightnumber | string400The height of the viewer; a number is px.
environmentstring"studio"The lighting room: studio, city, sunset, dawn, warehouse, apartment, lobby, night, park, forest or none.
environmentIntensitynumber1The strength of the room's light and reflections.
exposurenumber1The overall brightness of the render.
intro"rise" | "spin" | "fade" | "none""rise"How the model appears once it has loaded.
autoRotatebooleantrueThe model turns slowly while idle.
autoRotateSpeednumber0.4The speed of the idle turn.
autoRotateDelaynumber2Seconds after letting go before the idle turn eases back in.
dragRotatebooleantrueDrag to turn the model, with momentum on release.
turntablebooleanfalseDragging only turns left and right, like a product turntable.
zoombooleantruePinch, or hold Ctrl or Cmd and scroll, to zoom; plain scrolling still scrolls the page.
minZoomnumber0.7How far out it zooms, as a multiple of the fitted view.
maxZoomnumber2How far in it zooms, as a multiple of the fitted view.
hoverTiltnumber0.15How much the model leans toward the cursor; 0 turns it off.
floatnumber0.3A gentle float above the shadow; 0 turns it off.
shadowbooleantrueA soft contact shadow under the model.
shadowOpacitynumber0.45The darkness of the shadow.
fitnumber0.8How much of the viewer the model fills; it is framed automatically.
offsetXnumber0Moves the model sideways, -1 to 1.
offsetYnumber0Moves the model up or down, -1 to 1.
startAnglenumber-30The starting angle around the model in degrees.
tiltnumber10The starting tilt toward the viewer in degrees.
resetOnDoubleClickbooleantrueA double click returns to the starting view.
onModelLoaded() => voidNoneCalled once the model has loaded.
refRef<ModelStageHandle>NoneExposes capture(type?), which returns the current frame as an image data URL.
backgroundColorstring"transparent"The backdrop colour; `transparent` lets the page show through.
onError(error: unknown) => voidNoneCalled when the file cannot be loaded.
classNamestringNone
styleCSSPropertiesNoneInline styles for the container.

Related