popupS

A simple way to display beautiful popupS.
×

Install

Method 1: Install through NPM:

 
                            npm install popups --save
                        

Method 2: Download the CSS and JavaScript files.

Download ZIP
 

Initialize the plugin by referencing the necessary files:

    

How to use

 

You can create a new popup window by calling:

    popupS.window({
    mode: 'alert',
    content: 'Hey'
});

Or by using the shorthand form:

    popupS.alert({
    content: 'Hello'
});

Examples

Alert


×
Hello World!
   popupS.alert({
        content: 'Hello World!'
    });

Confirm


×
Continue?
   popupS.confirm({
        content: 'Continue?',
        onSubmit: function() {
                popupS.alert({
                        content: 'Great!'
                });
        }
    });

Prompt


×
What is your name?
   popupS.prompt({
        content: 'What is your name?',
        onSubmit: function(val) {
                popupS.alert({
                        content: 'Hi, ' + val + '!'
                });
        }
    });

Modal


×
   popupS.modal({
            content: '
' });

React implementation


×
   popupS.modal({
        onOpen: function() {
                React.render(
                        searchExample,
                        this.$contentEl
                );
        },
        onClose: function() {
                this.$layerEl.style.opacity = "0";
                React.unmountComponentAtNode(this.$contentEl);
        }
    });
Fork me on GitHub