Home

Awesome

Vodal Dependency Status NPM downloads

A vue modal with animations. Example

Installation

npm i -S vodal

Usage

<vodal :show="show" animation="rotate" @hide="show = false">
    <div>A vue modal with animations.</div>
</vodal>
import Vue from 'vue';
import Vodal from 'vodal';

Vue.component(Vodal.name, Vodal);

export default {
  name: 'app',
    
  data() {
    return {
      show: false
    }
  }
}
// include animation styles
@import "vodal/common.css";
@import "vodal/rotate.css";

Props

PropertyTypeDefaultDescription
widthnumber400width of dialog
heightnumber240height of dialog
measurestringpxmeasure of width and height
showboolfalsewhether to show dialog
maskbooltruewhether to show mask
closeButtonbooltruewhether to show close button
closeOnEscboolfalsewhether close dialog when esc pressed
closeOnClickMaskbooltruewhether close dialog when mask clicked
animationstringzoomanimation type
durationnumber300animation duration
classNamestring/className for the container
customStylesobject/custom dialog styles
customMaskStylesobject/custom mask styles

Event

NameDescription
hidetriggers when dialog will hide
clickMasktriggers when mask clicked

Animation Types

Other

React version