Methods
load(src: string | AnimationItem, overrideRendererSettings?: Record<string, unknown>, playbackOptions?: PlaybackOptions) => Promise<void>
load(src: string | AnimationItem, overrideRendererSettings?: Record<string, unknown>, playbackOptions?: PlaybackOptions) => Promise<void>
Load (and play) a given Lottie animation.
Parameters
Returns
Type: Promise<void>
pause() => void
pause() => void
Pause animation play.
Returns
Type: void
play(targetAnimation?: string | number, playbackOptions? PlaybackOptions) => void
play(targetAnimation?: string | number, playbackOptions? PlaybackOptions) => void
Play the current or target animation. If playbackOptions are passed, they will override the playback settings defined for the animation in the manifest.
Parameters
Returns
Type: void
next(playbackOptions?: PlaybackOptions) => void
next(playbackOptions?: PlaybackOptions) => void
Start playing next animation. If playbackOptions are passed, they will override the playback settings defined for the animation in the manifest.
Parameters
Returns
Type: void
previous(playbackOptions?: PlaybackOptions) => void
previous(playbackOptions?: PlaybackOptions) => void
Start playing the previous animation. If playbackOptions are passed, they will override the playback settings defined for the animation in the manifest.
Parameters
Returns
Type: void
reset() => void
reset() => void
Revert to default animation, 'activeAnimationId' is used from the manifest. If this setting is not present, this method will revert to playing the first animation defined in the manifest.
If playbackOptions are passed, they will override the playback settings defined for the animation in the manifest.
Returns
Type: void
setDirection(value: number) => void
setDirection(value: number) => void
Animation play direction.
Parameters
Returns
Type: void
getLottie() => AnimationItem
getLottie() => AnimationItem
Returns the lottie-web instance used in the component.
Returns
Type: AnimationItem
getVersions() => { lottieWebVersion: string, dotLottiePlayerVersion: string }
getVersions() => { lottieWebVersion: string, dotLottiePlayerVersion: string }
Returns the version of lottie-web and the dotlottie player.
Returns
Type: Versions
setLooping(value: boolean) => void
setLooping(value: boolean) => void
Sets the looping of the animation.
Parameters
Returns
Type: void
setSpeed(value?: number) => void
setSpeed(value?: number) => void
Sets animation play speed.
Parameters
Returns
Type: void
stop() => void
stop() => void
Stops animation play.
Returns
Type: void
seek(value: number | string) => void
seek(value: number | string) => void
Seek to a given frame. Frame value can be a number or a percent string (e.g. 50%).
Returns
Type: void
snapshot(download?: boolean) => string
snapshot(download?: boolean) => string
Snapshot the current frame as SVG. If ‘download’ argument is boolean true, then a download is triggered in browser.
Returns
Type: string
toggleLooping() => void
toggleLooping() => void
Toggles animation looping.
Returns
Type: void
togglePlay() => void
togglePlay() => void
Toggle playing state.
Returns
Type: void
getManifest() => Manifest
Returns
Type: Manifest
Last updated