mini-alert-confirm

1.0.6 • Public • Published

mini-alert-confirm

NPM version

Simple and easy configurable alert/confirm dialog box for Javascript.

mini-alert-confirm

Installation

$ npm i mini-alert-confirm

Import

add the following code on your index.js

import miniAlertConfirm from 'mini-alert-confirm';
// import 'mini-alert-confirm/index.css'; // (optional css, if you want to customize the dialog box)

alert = function (text) { miniAlertConfirm(text); }
confirm = function (text, callback) { miniAlertConfirm(text, callback); }

Examples

after importing the library you can just call alert and confirm where/when you want

alert("I'm a beautiful alert popup!!");
confirm("Do you like this popup?", () => {
    console.log("I'm a callback if you press OK button");
})

Demo

Just a example project where you can see mini-alert-confirm in action..

License

Licensed under MIT

Package Sidebar

Install

npm i mini-alert-confirm

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

8.87 kB

Total Files

5

Last publish

Collaborators

  • orsifrancesco