nuxt-use-motion

๐Ÿคน A Nuxt module putting your components in motion
2,812
Install
npm install nuxt-use-motion@1.5.1
Latest Version:1.5.1
License:MIT
Last Updated:Dec 29, 2021
Links: npm
Maintainer: tahul

๐Ÿคน nuxt-use-motion

This module is a Nuxt implementation of the Vue Composables @vueuse/motion.

For a better understanding of this module, you should check out the original composables page.

๐ŸŒ Documentation

๐Ÿ‘€ Demos

Setup

Once you installed it, add nuxt-use-motion dependency to your project

pnpm add --dev nuxt-use-motion
# or
npm i -D nuxt-use-motion

Add nuxt-use-motion to the buildModules section of nuxt.config.js

// nuxt.config.js
{
  buildModules: ['nuxt-use-motion']
}

Configure your animations ๐Ÿคน

// nuxt.config.js
{
  motion: {
    directives: {
      'pop-bottom': {
        initial: {
          scale: 0,
          opacity: 0,
          y: 100
        },
        visible: {
          scale: 1,
          opacity: 1,
          y: 0
        },
      }
    }
  }
}

Usage

In addition to the native @vueuse/motion features, the module allows you to define animations presets from your nuxt.config.js.

Once defined, as shown above, those animations will be available using directives, available in every component of your app.

<template>
  <div v-motion-pop-bottom>Pop from bottom! ๐ŸŽบ</div>
</template>

To see more about how to control animations declared with directives, check out Directive Usage.

To see more about what properties you can animate, check out Motion Properties.

To see more about how to create your own animations styles, check out Transition Properties.

To see more about what are variants and how you can use them, check out Variants.

To see more about how to control your declared variants, check out Motion Instance.

Development

  1. Clone this repository
  2. Install dependencies using pnpm install
  3. Start development server using pnpm dev

License

MIT License

Related Packages

@docus/core-edge

The Docus core.

8,638
@docus/app-edge

The Docus default app.

8,488
@docus/app

The Docus default app.

5,187
@docus/core

The Docus core.

4,814
@docus/theme

The Docus default theme.

3,016

Version History

Version Released License
1.5.1 MIT
1.5.0 MIT
1.4.0 MIT
1.3.0 MIT
1.1.0 MIT
Pre-releases (7)
Version Released License
2.0.0-beta.11 MIT
2.0.0-beta.10 MIT
2.0.0-beta.9 MIT
2.0.0-beta.8 MIT
2.0.0-beta.5 MIT