Add Lottie animated icons to any HTML page via CDN — no build tools or framework required.
Add the CDN script tag to your HTML page's
or before your closing tag.<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js"></script>Create a container div for your animation. Set its size with CSS or inline styles.
<div id="lottie-container" style="width: 150px; height: 150px;"></div>Call lottie.loadAnimation() with the path to your downloaded icon JSON file.
<script>
var animation = lottie.loadAnimation({
container: document.getElementById('lottie-container'),
renderer: 'svg',
loop: true,
autoplay: true,
path: 'your_animation.json' // Path to your downloaded icon
});
</script>Use the animation instance to pause, play, or stop at any time.
animation.pause(); // Pause
animation.play(); // Resume
animation.stop(); // Stop and reset