1<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
2<script>swal("My title", "My description", "success");</script>
1Swal.fire({
2 title: 'example text',
3 buttonsStyling: false,
4 customClass: {
5 confirmButton: 'example-class' //insert class here
6 }
7})
1Swal.fire({
2 title: 'Do you want to save the changes?',
3 showDenyButton: true,
4 showCancelButton: true,
5 confirmButtonText: `Save`,
6 denyButtonText: `Don't save`,
7}).then((result) => {
8 /* Read more about isConfirmed, isDenied below */
9 if (result.isConfirmed) {
10 Swal.fire('Saved!', '', 'success')
11 } else if (result.isDenied) {
12 Swal.fire('Changes are not saved', '', 'info')
13 }
14})
1swal({
2 title: "Deleted!",
3 text: "Your row has been deleted.",
4 button: "Close", // Text on button
5 icon: "success", //built in icons: success, warning, error, info
6 timer: 3000, //timeOut for auto-close
7 buttons: {
8 confirm: {
9 text: "OK",
10 value: true,
11 visible: true,
12 className: "",
13 closeModal: true
14 },
15 cancel: {
16 text: "Cancel",
17 value: false,
18 visible: true,
19 className: "",
20 closeModal: true,
21 }
22 }
23 });