Learn how to integrate lottie animations into your vue application effortlessly.
Install lottie web dependency from npm
npm install lottie-web
Import animated icon json file in your component
<template>
<div ref="lottieContainer" style="width: 150px; height: 150px;"></div>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import lottie from 'lottie-web'
import animationData from '@/assets/your_animation.json'
const lottieContainer = ref(null)
onMounted(() => {
lottie.loadAnimation({
container: lottieContainer.value,
renderer: 'svg',
loop: true,
autoplay: true,
animationData
})
})
</script>
Find free animations at Unicornicons.