Usage
Custom Playback Controls
DotLottieSvelte
component makes it easy to build custom playback controls for the animation. It exposes a dotLottieRefCallback
prop that can be used to get a reference to the dotLottie
web player instance. This instance can be used to control the playback of the animation using the methods exposed by the dotLottie web player instance.
Here is an example:
You can find the list of methods that can be used to control the playback of the animation here.
Listening to Events
DotLottieSvelte
component can receive a dotLottieRefCallback
prop that can be used to get a reference to the dotLottie
web player instance. This reference can be used to listen to player events emitted by the dotLottie
web instance.
Here is an example:
dotLottie instance exposes multiple events that can be listened to. You can find the list of events here.