Properties

DotLottie instances expose the following properties:

Animation State

  • isReady: boolean - Whether the WASM module is loaded and ready
  • isLoaded: boolean - Whether animation data is loaded
  • isPlaying: boolean - Whether animation is currently playing
  • isPaused: boolean - Whether animation is paused
  • isStopped: boolean - Whether animation is stopped
  • isFrozen: boolean - Whether rendering is frozen

Animation Information

  • currentFrame: number - Current frame number
  • totalFrames: number - Total number of frames in animation
  • duration: number - Total animation duration in seconds
  • segmentDuration: number - Duration of current segment in seconds
  • loopCount: number - Current loop count

Configuration Properties

  • activeAnimationId: string | undefined - Currently active animation ID
  • activeThemeId: string | undefined - Currently active theme ID
  • autoplay: boolean - Auto-play setting
  • backgroundColor: string - Background color
  • loop: boolean - Loop setting
  • mode: Mode - Current playback mode
  • speed: number - Current playback speed
  • segment: [number, number] | undefined - Current frame segment
  • useFrameInterpolation: boolean - Frame interpolation setting

Canvas & Data

  • canvas: HTMLCanvasElement | OffscreenCanvas - Canvas element
  • buffer: Uint8Array | null - Raw pixel buffer data
  • manifest: Manifest | null - DotLottie manifest information

Detailed Property Descriptions

PropertyTypeDescription
currentFramenumberRepresents the animation’s currently displayed frame number.
durationnumberSpecifies the animation’s total playback time in seconds.
totalFramesnumberDenotes the total count of individual frames within the animation.
loopbooleanIndicates if the animation is set to play in a continuous loop.
speednumberRepresents the playback speed factor; e.g., 2 would mean double speed.
loopCountnumberTracks how many times the animation has completed its loop.
modeModeReflects the current playback mode.
isPausedbooleanReflects whether the animation is paused or not.
isStoppedbooleanReflects whether the animation is stopped or not.
isPlayingbooleanReflects whether the animation is playing or not.
isReadybooleanWhether the WASM module is loaded and ready.
isLoadedbooleanReflects whether the animation is loaded or not.
isFrozenbooleanReflects whether the animation loop is stopped or not.
segment[number, number] | undefinedReflects the frames range of the animations. where segment[0] is the start frame and segment[1] is the end frame.
segmentDurationnumberDuration of current segment in seconds.
backgroundColorstringGets the background color of the canvas.
autoplaybooleanIndicates if the animation is set to auto-play.
useFrameInterpolationbooleanReflects whether the animation should update on subframes.
renderConfigRenderConfigConfiguration for rendering the animation.
manifestManifest | nullThe manifest of the loaded dotLottie file.
activeAnimationIdstring | undefinedCurrently active animation ID.
activeThemeIdstring | undefinedThe ID of the currently active theme.
canvasHTMLCanvasElement | OffscreenCanvasCanvas element used for rendering.
bufferUint8Array | nullRaw pixel buffer data.