1.0.0 • Published 2 years ago

@i-is-as-i-does/vue-3-slide-fade v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Vue 3 Slide Fade

Quick and dirty fork of Craig Riley's vue3-slide-up-down
Added optional fade in / fade out support

Regarding transitions, you might also take a look at 'Vâlvă'
You'll find a Vue 3 component in 'src/vue'

Usage

The component takes 8 props:

nametyperequireddescriptiondefault
v-model*booleanyesWhether to show the component or notN/A
fadebooleannoAnimate opacity or notfalse
durationnumbernoHow long the animation will be in ms400
slideTimingstringnoCSS transition-timing-function applied to height"ease-in-out"
fadeTimingstringnoCSS transition-timing-function applied to opacity"ease-in-out"
tagstringnoThe HTML tag to use for the wrapper element"div"
responsivebooleannoAnimate height when contents are changedfalse
  • or modelValue if a method is required
<div class="MyContent">
  <h1>Always show this</h1>
  <ul>
<li v-for="(item, index) in list" :key="index">
  <slide-fade :modelValue="isActive(index)" :fade="true">
    Only show this if "isActive(index)" returns true
  </slide-fade>
<li>
  </ul>
</div>

The component emits five Vue events:

  • open-start
  • open-end
  • close-start
  • close-end
  • layout-shift
<slide-fade @close-end="() => console.log('done closing!')" />