0.0.5 ⢠Published 3 months ago
motion-vuejs v0.0.5
Vue Motion
A Vue.js component for creating smooth animations and transitions with minimal effort. This is a Vue.js port of motion.dev, bringing its powerful animation capabilities to the Vue ecosystem.
š Documentation and Examples: https://motion-vuejs.vercel.app/
Installation
npm install vue-motion
Usage
Global Registration
import { createApp } from 'vue'
import Motion from 'vue-motion'
const app = createApp(App)
app.use(Motion)
Local Registration
import { Motion } from 'vue-motion'
export default {
components: {
Motion
}
}
Features
The Motion component provides a rich set of animation capabilities:
- Enter/Exit Animations: Animate elements when they mount or unmount
- Hover Animations: Add interactive animations when users hover over elements
- Tap/Press Animations: Animate elements when users click or tap
- Scroll-based Animations: Trigger animations when elements come into view
- Custom Transitions: Control animation duration, easing, and timing
- Flexible Element Types: Use any HTML element or component as the motion wrapper
Props
as
: Type of element to render (default: 'div')enter
: Animation properties for element entranceexit
: Animation properties for element exitanimate
: General animation propertiestransition
: Transition settings (duration, easing)whileHover
: Animation properties during hoverwhileTap
: Animation properties during press/tapshow
: Control element visibilityinView
: Enable scroll-based animationsreverseOutView
: Reverse animation when scrolling out of view
Development
- Install dependencies:
npm install
- Build the package:
npm run build
License
MIT