Learn how to integrate rive animations into your vue application effortlessly.
Install rive web dependency from npm
npm install @rive-app/webgl
Import animated icon json file in your component
<template>
<canvas ref="riveCanvas" width="150" height="150" />
</template>
<script setup>
import { onMounted, ref } from "vue";
import { Rive } from "@rive-app/webgl";
const riveCanvas = ref(null);
onMounted(() => {
new Rive({
src: "/your_animation.riv",
canvas: riveCanvas.value,
autoplay: true,
artboard: "Main",
stateMachines: ["State Machine 1"], // Clicked , Hover
});
});
</script>
Find free animations at Unicornicons.