Properties
DotLottie
instances expose the following properties:
Animation State
isReady: boolean
- Whether the WASM module is loaded and readyisLoaded: boolean
- Whether animation data is loadedisPlaying: boolean
- Whether animation is currently playingisPaused: boolean
- Whether animation is pausedisStopped: boolean
- Whether animation is stoppedisFrozen: boolean
- Whether rendering is frozen
Animation Information
currentFrame: number
- Current frame numbertotalFrames: number
- Total number of frames in animationduration: number
- Total animation duration in secondssegmentDuration: number
- Duration of current segment in secondsloopCount: number
- Current loop count
Configuration Properties
activeAnimationId: string | undefined
- Currently active animation IDactiveThemeId: string | undefined
- Currently active theme IDautoplay: boolean
- Auto-play settingbackgroundColor: string
- Background colorloop: boolean
- Loop settingmode: Mode
- Current playback modespeed: number
- Current playback speedsegment: [number, number] | undefined
- Current frame segmentuseFrameInterpolation: boolean
- Frame interpolation setting
Canvas & Data
canvas: HTMLCanvasElement | OffscreenCanvas
- Canvas elementbuffer: Uint8Array | null
- Raw pixel buffer datamanifest: Manifest | null
- DotLottie manifest information
Detailed Property Descriptions
Property | Type | Description |
---|---|---|
currentFrame | number | Represents the animation’s currently displayed frame number. |
duration | number | Specifies the animation’s total playback time in seconds. |
totalFrames | number | Denotes the total count of individual frames within the animation. |
loop | boolean | Indicates if the animation is set to play in a continuous loop. |
speed | number | Represents the playback speed factor; e.g., 2 would mean double speed. |
loopCount | number | Tracks how many times the animation has completed its loop. |
mode | Mode | Reflects the current playback mode. |
isPaused | boolean | Reflects whether the animation is paused or not. |
isStopped | boolean | Reflects whether the animation is stopped or not. |
isPlaying | boolean | Reflects whether the animation is playing or not. |
isReady | boolean | Whether the WASM module is loaded and ready. |
isLoaded | boolean | Reflects whether the animation is loaded or not. |
isFrozen | boolean | Reflects whether the animation loop is stopped or not. |
segment | [number, number] | undefined | Reflects the frames range of the animations. where segment[0] is the start frame and segment[1] is the end frame. |
segmentDuration | number | Duration of current segment in seconds. |
backgroundColor | string | Gets the background color of the canvas. |
autoplay | boolean | Indicates if the animation is set to auto-play. |
useFrameInterpolation | boolean | Reflects whether the animation should update on subframes. |
renderConfig | RenderConfig | Configuration for rendering the animation. |
manifest | Manifest | null | The manifest of the loaded dotLottie file. |
activeAnimationId | string | undefined | Currently active animation ID. |
activeThemeId | string | undefined | The ID of the currently active theme. |
canvas | HTMLCanvasElement | OffscreenCanvas | Canvas element used for rendering. |
buffer | Uint8Array | null | Raw pixel buffer data. |