You may set and load animations programmatically as well.
React.js / Next.js
Nuxt.js / Vue.js
Update the array of plugins in nuxt.config.js file in your root.
Create a plugin folder in your root if it doesnt exist already, add a file named e. g. lottie-player.js with the following content:
The component can now be used in your pages or components template tag like below – without any imports necessary.
We proudly claim this to be the most versatile, lightweight and efficient Lottie Player Web Component available. It's compatible with server side rendering, and completely framework agnostic. In addition to being a fast-loading, low-RAM-using player it also contains the functionality to combine animations, control each animation in a single file, and convert JSON-animations to dotLottie.
Add the element dotlottie-player to you code and point it to a Lottie file of your choice.