npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuejs-overlay

v0.0.28

Published

Overlay (popup) component for Vue.js

Downloads

66

Readme

vuejs-overlay

Travis Build Version Downloads

Vue.js Overlay

Vue.js Overlay is a practical, modern and convenient overlay (popup) Vue.js component.

What?

It is a stylish popup component for Vue.js that you can easily use in your projects.
The most important features are flexible, modern, animated, stable, lightweight.

Install

npm install vuejs-overlay --save

Usage

<div id="app">
    <overlay :opened="opened" :visible="visible" @closed="opened = visible = false">
        <span>My popup</span>
    </overlay>
    
    <button @click="opened = visible = true">Open Popup</button>
</div>
// ES6
import Overlay from 'vuejs-overlay';

new Vue({
    el: '#app',
    data() {
        return {
            opened: false,
            visible: false
        }
    },
    components: {
        Overlay
    }
});

Configurations

You can make the configurations with props.

| Configuration | Type | Default | Description | | ----------------------------------| ---------------- | ------------------------ | ------------------------------------------------------------- | | animate | String, Boolean | false | You can choose which animation the popup will open and close. | | backdrop | Boolean | true | Specifies whether the popup has a backdrop. | | close-on-escape | Boolean | true | This is to close the popup with the escape key. | | close-on-cancel | Boolean | true | This is to close the popup with the cancel button. | | close-by-backdrop-click | Boolean | true | This is to close the popup when the backdrop is clicked. | | closeable | Boolean | true | Closing feature of the popup. You can use it in critical form operations. | | opened | Boolean | false | Specifies the popup is opened. | | header | String, Boolean | false | Used to determine the header text of the popup. | | visible | Boolean | false | Specifies that internal elements are loaded of the popup. |

Available animate options:

"bounce", "fade", "slide-down", "slide-left", "slide-right", "slide-up", "zoom-in", "zoom-out", false.

<overlay animate="zoom-in" :opened="opened" :visible="visible" @closed="opened = visible = false">
    <div>👍</div>
</overlay>

animate: zoom-in

Usage asynchronously:

Let's take an example of content data with ajax. In this example we used vuejs-ajax library.

<div id="app">
    <overlay :opened="opened" :visible="visible" @closed="onClosed">
        <span v-text="text"></span>
    </overlay>
    
    <button @click="openHandle">Open Popup</button>
</div>
import ajax from "vuejs-ajax";
import {Overlay} from 'vuejs-overlay.js';
Vue.use(ajax);

new Vue({
    el: '#app',
    data() {
        return {
            opened: false,
            visible: false,
            text: null,
        }
    },
    methods: {
        openHandle() {
            this.overlayOpened = true;

            Vue.ajax.get("example.com/my-request-url").then(response => {
                this.text = response.data;
                this.visible = true;
            });
        },
        onClosed() {
            this.opened = false;
            this.visible = false;
        }
    },
    components: {
        Overlay
    }
});

Events

| Configuration | Type | Description | | ----------------------------------| ---------------- | ------------------------------------------------------------- | | @closed | Callback | Triggers when the popup is closed. We recommend that you use this to ensure stable operation of this component when closing the popup. | | @opened | Callback | Triggers when the popup is opened. |

<overlay :opened="opened" :visible="visible" @closed="opened = visible = false" @opened="someCallback">
    <span>My popup</span>
</overlay>

License

MIT

Copyright (c) 2019 Fatih Koca