Documentation

Documentation

JavaScript
Vue

Motion One and Framer Motion have combined into Motion! Read more

Motion One and Framer Motion have combined into Motion! Read more

Vue

Motion+ Early Access

Motion+ Early Access

Checking Motion+ status…

Unlocks for everyone in

45 Days 09 Hours 20 Minutes

Or

Already joined?

Checking Motion+ status…

Unlocks for everyone in

45 Days 09 Hours 20 Minutes

Or

Already joined?

Checking Motion+ status…

Unlocks for everyone in

45 Days 09 Hours 20 Minutes

Or

Already joined?

Motion is fully framework agnostic, therefore it works within any JavaScript environment, including Vue 3.

In this guide, we'll learn how to:

  • Animate on enter and exit

  • Animate timeline sequences

  • Animate when props change

  • Change HTML and CSS when an element enters or leaves the viewport

  • Animate on scroll

Install

Install Motion into the Vue project.

npm

Enter and exit animations

To animate elements when they enter and exit the DOM, we can use Vue's Transition component.

<template>
  <Transition :css="false">
    <h1>Hello world</h1>
  </Transition>
</template>

<style>
  h1 { opacity: 0; }
</style>