Readme

lottie-animation

Properties

Property Attribute Description Type Default
autoplay autoplay start animation automatically boolean false
dataJson -- data JSON {} {}
loop loop loop animation boolean false
src src data JSON location string ''

Events

Event Description Type
onAnimationLoaded triggered when the animation is loaded (event.detail.animation contains the Lottie animation item). CustomEvent<void>

Methods

getTotalFrames() => Promise<number>

gets the number of frames

Returns

Type: Promise<number>

goToAndStop(value: number, isFrame?: boolean) => void

plays the animation until a certain frame, or time

Parameters

Name Type Description
value number
isFrame boolean

Returns

Type: void

play() => void

plays the animation

Returns

Type: void

progress(progress: number) => void

sets the animation progress to a certain point (0..1)

Parameters

Name Type Description
progress number

Returns

Type: void

setDirection(direction: number) => void

sets the direction of the animation

Parameters

Name Type Description
direction number

Returns

Type: void

setSpeed(speed: number) => void

sets the speed of the animation

Parameters

Name Type Description
speed number

Returns

Type: void

stop() => void

stops the animation

Returns

Type: void


Built with StencilJS