vue3-transitions
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Install

npm i vue3-transitions
or
yarn add vue3-transitions

Usage

Demo code can be found under the docs section here.

Import globally

import { createApp } from 'vue'
import App from './App.vue'
import Vue3Transitions from 'vue3-transitions'

const app = createApp(App)
app.use(Vue3Transitions)
app.mount('#app')

Router view

Vue recommends using a transition mode - more info here
<template>
  <router-view v-slot="{ Component }">
    <FadeInOut entry="left" exit="left" :duration="500" mode="out-in">
      <component :is="Component" />
    </FadeInOut>
  </router-view>
</template>

<script>
import { defineComponent } from 'vue'
import { FadeInOut } from 'vue3-transitions'

export default defineComponent({
  components: { FadeInOut }
})
</script>

As a component

<template>
  <button @click="triggerFade = !triggerFade" >
    Trigger animation
  </button>
  <FadeInOut entry="left" exit="left" :duration="500">
    <h1 v-if="triggerFade">Fade in and out transition</h1>
  </FadeInOut>
</template>

<script>
import { defineComponent, ref } from 'vue'
import { FadeInOut } from 'vue3-transitions'

export default defineComponent({
  components: { FadeInOut },
  setup() {
    const triggerFade = ref(false)
    return {
      triggerFade
    }
  }
})
</script>

Tree Shaking

Import components from the esm folder to enable tree shaking.

<script>
import { defineComponent } from 'vue'
import { FadeInOut } from 'vue3-transitions/esm'

export default defineComponent({
  components: { FadeInOut }
})
</script>

Available components

  1. FadeInOut - Single, Group
  2. SlideInOut - Single, Group
  3. ZoomInOut (coming soon)
  4. RollInOut (coming soon)

...plus more coming soon

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.0165latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.0165
0.2.62
0.2.50
0.2.40
0.2.30
0.2.10
0.2.00
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.21
0.0.10

Package Sidebar

Install

npm i vue3-transitions

Weekly Downloads

168

Version

1.0.0

License

MIT

Unpacked Size

283 kB

Total Files

23

Last publish

Collaborators

  • randolphtellis