CodeSandbox for this example.
Illustration from Pebble People by Deivid Saenz.
yarn add @vueuse/motion
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(),
},
}
Usage
- How to use directives? Check out Directive Usage.
- What properties you can animate? Check out Motion Properties.
- How to create your own animations styles? Check out Transition Properties.
- What are variants and how you can use them? Check out Variants.
- How to control your declared variants? Check out Motion Instance.
Table of Contents