sweetalert

A beautiful replacement for JavaScript's "alert"

#SweetAlert

An awesome replacement for JavaScript’s alert.

See it in action!

A success modal

#Usage

You can install SweetAlert through bower:

bower install sweetalert

Alternatively, download the package and reference the JavaScript and CSS files manually:

<script src="lib/sweet-alert.min.js"></script>
<link rel="stylesheet" type="text/css" href="lib/sweet-alert.css">

#Examples

The most basic message:

sweetAlert("Hello world!");

A message signaling an error:

sweetAlert("Oops...", "Something went wrong!", "error");

A warning message, with a function attached to the “Confirm”-button..

sweetAlert({
  title: "Are you sure?",
  text: "You will not be able to recover this imaginary file!",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false
}, function(){
  swal("Deleted!",
  "Your imaginary file has been deleted.",
  "success");
});

View more examples

#Related projects

Related Repositories

sweetalert

sweetalert

A beautiful replacement for JavaScript's "alert" ...

sweet-alert-dialog

sweet-alert-dialog

SweetAlert for Android, a beautiful and clever alert dialog ...

bootstrap-sweetalert

bootstrap-sweetalert

:cake: A beautiful "replacement" for JavaScript's alert ...

SweetAlert-iOS

SweetAlert-iOS

Live animated Alert View for iOS written in Swift ...

ngSweetAlert

ngSweetAlert

AngularJS wrapper for SweetAlert ...