vueuse / motion

🤹 Vue Composables putting your components in motion
https://motion.vueuse.org
MIT License
2.37k stars 82 forks source link

How to create sequence enter div animation one by one #84

Closed myomyintaung1411 closed 5 months ago

BobbieGoede commented 5 months ago

You can create a staggered div animation by adding delays to each div, here's an example:

<div>
    <img
      v-for="index in 5"
      :key="index"
      v-motion
      :initial="{ scale: 0, opacity: 0 }"
      :visible-once="{ scale: 1, opacity: 1 }"
      :delay="index * 200"
    />
</div>

Note the :delay="index * 200" which adds a longer delay for each following div, I've also created a demonstration here.

Closing this, let me know if you have any questions!