Sweetalert

sweetalert

An awesome replacement/alternative for alert().

sweetalert is an alternative to annoying alert, it's rather a sweet a simple modal box.

Get it: npm install --save sweetalert

Usage:

1
const swal = require('sweetalert');
1
swal("Oops...", "Something went wrong!", "error");
1
2
3
4
5
6
7
8
9
10
11
12
13
swal({
  title: 'Ajax request example',
  text: 'Submit to run ajax request',
  type: 'info',
  showCancelButton: true,
  closeOnConfirm: false,
  disableButtonsOnConfirm: true,
  confirmLoadingButtonColor: '#DD6B55'
}, function(inputValue){
  setTimeout(function() {
    swal('Ajax request finished!');
  }, 2000);
});

GIF FTW!

Suggest a module

Comments