1.0.6 ā€¢ Published 3 years ago

vue-lightweight-modal v1.0.6

Weekly downloads
37
License
-
Repository
github
Last release
3 years ago

Super Lightweight Modal Nuxt & Vue

A Nuxt / Vue JS Modal, no dependency, no BS.

šŸ’„ Installation

NPM:

npm i vue-lightweight-modal

Yarn:

yarn add vue-lightweight-modal

šŸ­ Usage

In Component

import Modal from 'vue-lightweight-modal'

export default {
  components: {
    Modal,
  },
}

šŸæ Props

nametypedefault
showBooleanfalseshow/hide modal
videoBooleanfalseadd responsive 16:9 scaling to iframe
titleStringnulladd title to modal header
radiusNumber0add border radius to modal container
maxString'1000px'max-width of modal window
minString'0'min-width of modal window
durationString'900ms'animation duration

šŸ¾ Example

šŸ’¬ Regular Usage:

<template>
  <div>
    <button @click="showModal = true">Show Modal</button>
    <Modal
      :show="showModal"
      title="Hello World"
      :radius="6"
      @close="showModal = false"
    >
      <h2>Some Content</h2>
      <p>Add whatever you want</p>
    </Modal>
  </div>
</template>
<script>
import Modal from 'vue-lightweight-modal'

export default {
  data() {
    return {
      showModal: false,
    }
  },
  components: {
    Modal,
  },
}
</script>

šŸŽ„ Embed Video (iframe):

<template>
  <div>
    <button @click="showModal = true">Show Modal</button>
    <Modal
      :show="showModal"
      :video="true"
      title="Hello World"
      :radius="6"
      @close="showModal = false"
    >
      <iframe
        width="560"
        height="315"
        src="https://www.youtube.com/embed/JltjT4UaxbY"
        frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
        allowfullscreen
      ></iframe>
    </Modal>
  </div>
</template>
<script>
import Modal from 'vue-lightweight-modal'

export default {
  data() {
    return {
      showModal: false,
    }
  },
  components: {
    Modal,
  },
}
</script>
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago