SweetAlert 2
Swal.fire('Hello world!');
Swal.fire("Good job!", "You clicked the button!", "success");
Swal.fire("Careful!", "This is a warning!", "warning");
Swal.fire("Oops...", "Something went wrong!", "error");
Swal.fire("FYI", "Some info for you.", "info");
Swal.fire("Are you sure?", "", "question");
Swal.fire({
title: "Are you sure?",
showCancelButton: true,
confirmButtonText: "Yes",
icon: "warning"
});
Swal.fire({
title: "Enter your name",
input: "text",
showCancelButton: true,
inputValidator: (value) => {
if (!value) return "You need to write something!";
}
});
Swal.fire({
title: "Loading...",
html: "Please wait...",
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
setTimeout(() => {
Swal.fire("Done!", "Ajax request finished", "success");
}, 2000);
}
});