Installation

Install @vueuse/motion using your package manager of choice.

pnpm add @vueuse/motion

Please note that if you are using Vue 2 or Nuxt, you need to install the Composition API.

The required packages can be found here for Vue 2, and here for Nuxt.

Plugin Installation

If you are planning on using the directives (v-motion) from this package, you might want to add the plugin to your Vue instance.

Global Installation

You can add the support for v-motion globally, by installing the plugin.

import { MotionPlugin } from '@vueuse/motion'

const app = createApp(App)

app.use(MotionPlugin)

app.mount('#app')

Component Installation

If you want to import the directive code only from components that uses it, import the directive and install it at component level.

import { directive as motion } from '@vueuse/motion'

export default {
  directives: {
    motion: motion(),
  },
}