Learn how to integrate lottie animations into your HTML page effortlessly.
Use the CDN link to include rive Script in your HTML page or use the local file path.
<script src="https://unpkg.com/@rive-app/webgl@2.9.1"></script>
<canvas id="rive-canvas" width="150" height="150"></canvas>
<script>
const canvas = document.getElementById("rive-canvas");
new rive.Rive({
src: "your_animation.riv",
canvas: canvas,
autoplay: true,
stateMachines: ["Clicked", "Hover"],
artboard: "Main",
onLoad: () => console.log("Rive loaded")
});
</script>
Find free animations at Unicornicons.