New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vueuse/motion

Package Overview
Dependencies
Maintainers
3
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vueuse/motion

🤹 A Vue Composable that puts your components in motion

  • 1.0.0-beta.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

🤹 vue-use-motion

npm npm Netlify Status

A Vue Composable to put your components in motion.

  • 🧩 Written in TypeScript.
  • 🏎 Smooth animations based on Popmotion.
  • 🎮 Declarative API.
  • 🤟 Vue 2 & 3 support using vue-demi.

🌍 Documentation

This repository is still experimental, the API might be subject to changes.

Last update: 06/02/2021

Quick Start

Let's get started quick by installing the package and adding the plugin.

From your terminal:

yarn add @vueuse/motion

In your Vue app entry file:

import { createApp } from 'vue-demi'
import { MotionPlugin } from '@vueuse/motion'
import App from './App.vue'

const app = createApp(App)

app.use(MotionPlugin)

app.mount('#app')

You can now animate any of your component, HTML or SVG elements using v-motion.

<template>
  <div
    v-motion="'smoothestDiv'"
    :initial="{
      opacity: 0,
      y: 100,
    }"
    :enter="{
      opacity: 1,
      y: 0,
    }"
  />
</template>

<script setup>
import { useMotions } from '@vueuse/motion'

// Get access to motion controls using useMotions
const { smoothestDiv } = useMotions()

// From smoothest div to biggest div real quick 😎
smoothestDiv.apply({ scale: 4 })
</script>

If you want to know more about what properties you can animate, consider taking a look at Motion Properties.

If you want to know more about how to create your own animations styles, consider taking a look at Transition Properties.

If you want to know more about what are variants and how you can use them, consider taking a look at Variants.

If you want to know more about how to control your declared variants, consider taking a look at Motion Controls.

Credits

This package is heavily inspired by Framer Motion.

I would also like to thank antfu and patak for their kind help!

If you like this package, consider following me on GitHub and on Twitter.

👋

Keywords

FAQs

Package last updated on 06 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc