All Projects → MelMacaluso → vue-modal

MelMacaluso / vue-modal

Licence: other
Reusable Modal component, supports own custom HTML, text and classes.

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to vue-modal

React Native Alert Pro
The Pro Version of React Native Alert (Android & iOS)
Stars: ✭ 69 (+137.93%)
Mutual labels:  modal, dialog, popup
Pmalertcontroller
PMAlertController is a great and customizable alert that can substitute UIAlertController
Stars: ✭ 2,397 (+8165.52%)
Mutual labels:  modal, dialog, popup
Jalert
jQuery alert/modal/lightbox plugin
Stars: ✭ 73 (+151.72%)
Mutual labels:  modal, modals, popup
Popupdialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Stars: ✭ 3,709 (+12689.66%)
Mutual labels:  modal, dialog, popup
React Native Simple Dialogs
⚛ Cross-platform React Native dialogs based on the Modal component
Stars: ✭ 218 (+651.72%)
Mutual labels:  modal, dialog, popup
Sweetalert
A beautiful replacement for JavaScript's "alert"
Stars: ✭ 21,871 (+75317.24%)
Mutual labels:  modal, dialog, popup
Jbox
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
Stars: ✭ 1,251 (+4213.79%)
Mutual labels:  modal, dialog, popup
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (+3.45%)
Mutual labels:  modal, dialog, popup
Svelte Simple Modal
A simple, small, and content-agnostic modal for Svelte v3
Stars: ✭ 130 (+348.28%)
Mutual labels:  modal, dialog, popup
React Native Push Notification Popup
A <NotificationPopup/> component for presenting your own push notification in react-native app
Stars: ✭ 111 (+282.76%)
Mutual labels:  modal, dialog, popup
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+782.76%)
Mutual labels:  modal, dialog, modals
LSDialogViewController
Custom Dialog for iOS written in Swift
Stars: ✭ 74 (+155.17%)
Mutual labels:  modal, dialog, popup
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (-27.59%)
Mutual labels:  modal, dialog, popup
Django Admin Interface
django's default admin interface made customizable. popup windows replaced by modals. :mage: ⚡️
Stars: ✭ 717 (+2372.41%)
Mutual labels:  modal, modals, popup
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-51.72%)
Mutual labels:  modal, dialog, popup
React Poppop
A mobile support and multi-directional modal for ReactJS
Stars: ✭ 78 (+168.97%)
Mutual labels:  modal, dialog, popup
vue-modal
A customizable, stackable, and lightweight modal component for Vue.
Stars: ✭ 96 (+231.03%)
Mutual labels:  modal, dialog, popup
ngx-simple-modal
A simple unopinionated framework to implement simple modal based behaviour in angular (v2+) projects.
Stars: ✭ 50 (+72.41%)
Mutual labels:  modal, dialog, reusable
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (+244.83%)
Mutual labels:  modal, dialog, popup
Popmodal
jquery plugin for showing tooltips, titles, modal dialogs and etc
Stars: ✭ 149 (+413.79%)
Mutual labels:  modal, dialog, popup

Vue Modal 🖼

npm semantic-release CircleCI (all branches) Commitizen friendly

Reusable Modal component, supports own custom HTML, text and classes and/or passing a component. Featuring multiple modal content / buttons.

Intro

Reusable Modal component, supports own custom HTML, text and classes and/or passing a component. Featuring multiple modal content / buttons.

What this ISN'T

This component is not meant to be a bootstrap-ish already-styled-modal-replacer for Vue.

What this IS

Instead: it wants to take it a step further: it gives you a skeleton base structure where you are free to apply your own css styling according to your requirements/website and gives you freedom of formatting the content/arrows/buttons/events as you wish with little to no effort.

Features

  • Animated modal transition
  • Overlay on modal background
  • Custom event triggering on before-close and before-open
  • Conditional: Next/prev arrows, close button, paging
  • Next and prev arrow for switching between modal contents
  • Modal contents navigation with custom paging
  • CSS/HTML customisation of: prev/next arrows, modal content, modal navigation, modal trigger button/s

Demo

Vue modal animated demo

Installation

npm i @melmacaluso/vue-modal

Usage

Simply import it in your desired vue component as follows:

import Modal from "@melmacaluso/vue-modal";

Props

Prop Type Comment
btnText String Text label for modal button
modalContent String Pass here your html for the modal main modal
closeBtn Boolean Conditionally add a close button
closeBtn-content String Pass here your html for the close button
multiple Boolean Allow multiple buttons/content within the modal
modals Array Pass here an array of objects, they retain the same props within the array's scope ie. <scope>.btnText
showNav Boolean Conditionally show a navigation with each modal's btnText
showArrows Boolean Conditionally show an arrow based navigation
showArrowsCloseBtn Boolean Conditionally show an the close button between the prev/next arrows, it inherits closeBtn-content
arrowNextContent String Pass here your html for the next arrow
arrowPrevContent String Pass here your html for the previous arrow
@before-open Function Attach here your custom function, it will be invoked before the modal opens
@before-close Function Attach here your custom function, it will be invoked before the modal closes

Examples

Inline HTML:

<Modal
  btnText="Press me, senpai 😊"
  modalContent="
        <div>
          <h2> Hello I am a modal</h2>
          <p>I like stating the obvious: <b>the obvious</b></p>
          <p>Now, try this trick: <code>Ctrl + Shift + W </code> 😉</p>
        </div>
        "
  :closeBtn="true"
  closeBtn-content="
        <span>X</span>
        "
/>

Passing component:

<Modal
  btnText="Press me, senpai 😊"
  :closeBtn="true"
  closeBtnHTML="<span>X</span>"
>
  <ExampleComponent/>
</Modal>

Multiple buttons & modal content + custom functions:

<Modal
  :multiple="true"
  @before-open="yourOpenFn()"
  @before-close="yourCloseFn()"
  :modals="[
    {
      btnText: 'Press me 1',
      modalContent: 'This is <strong>the</strong> content 1'
    },
    {
      btnText: 'Press me 2',
      modalContent:
        '<img src=\'https://media.giphy.com/media/5exwXWg9u7yow/giphy.gif\'>'
    },
    {
      btnText: 'Press me 3',
      modalContent: 'This is the <h3>content 3</h3>'
    }
  ]"
  :showNav="true"
/>

From Api/Json feed + Prev/Next Arrows:

<Modal
  :multiple="true"
  :modals="formattedUsers"
  :showArrows="true"
/>

export default {
  data: () => {
    return {
      users: []
    }
  },
  mounted(){
    fetch('https://jsonplaceholder.typicode.com/users')
      .then(res => res.json())
      .then(res => this.users = res)
      .catch(err => console.log(err))
  },
  computed: {
    formattedUsers: function() {
      return this.users.map(user => {
        return {
          btnText: `${user.name}`,
          modalContent: `
            <h2>Email:${user.email}</h2>
            <h2>Phone:${user.phone}</h2>
          `
        };
      });
    }
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].