Skip to content

ModelLabViewer ​

component · /viewer

Props ​

PropTypeDefaultDescription
srcstringrequiredGLB or GLTF URL
presetViewerExportPayload—Full editor export
configDeepPartial<ViewerConfig>—Overrides preset viewer values
sequenceSequenceInput—Overrides stored sequence
textureUrlsRecord<string,string>—Replacement texture URL map
playSequencebooleantrue when a sequence existsPlay by elapsed time
sequenceProgressnumber—Deterministic normalized progress
sequenceLoopbooleansequence valueLoop override
sequenceSpeednumbersequence valueSpeed override; negative reverses
controlsbooleantrueShow OrbitControls behavior
controlsWhilePlayingbooleanfalseAllow interaction during sequence
autoFitbooleantrue without preset/sequenceFit after loading
dracoDecoderPathstring/draco/Draco decoder directory
resourcePathstring—Base for external GLTF resources
dpr`number[number,number]`[1, 2]
effectCinematicEffectConfig—Runtime material effect

Events ​

  • onLoad(info)
  • onError(error)
  • onTextureError(textureName, error)
  • onCameraChange(position, target)
  • onSequenceFrame(time, snapshot)
  • onSequenceComplete()

Ref methods ​

MethodResult
getModel()Pivot-root THREE.Object3D or null
getRenderer()THREE.WebGLRenderer or null
getCamera()Active camera or null
getPivot()Local pivot tuple
getPivotWorldPosition()Current world pivot
getBoundsCenter()Imported local bounds center
fitCamera()Reframe model
captureScreenshot()PNG data URL or null

Released under the MIT License.