mini-alert-confirm
v1.0.6
Published
Simple and easy configurable alert/confirm dialog box for Javascript.
Downloads
10
Maintainers
Readme
mini-alert-confirm
Simple and easy configurable alert/confirm dialog box for Javascript.
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