A beautiful replacement for JavaScript's "alert"
This is just a clone for Bootstrap of the original SweetAlert.
Tweet$ bower install bootstrap-sweetalert
Continue playing with the examples or check how to use it on GitHub.
swal("Here's a message!")
swal("Here's a message!", "It's pretty, isn't it?")
swal("Good job!", "You clicked the button!", "success")
swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
swal({
title: "Sweet!",
text: "Here's a custom image.",
imageUrl: 'thumbs-up.jpg'
});