swit alert code example
Example 1: swalert 2 show loader
Swal.fire({
title: 'Please Wait !',
html: 'data uploading',// add html attribute if you want or remove
allowOutsideClick: false,
onBeforeOpen: () => {
Swal.showLoading()
},
});
Example 2: switch alert
swal({
title: "Good job!",
text: "You clicked the button!",
icon: "success",
button: "Aww yiss!"
});
Example 3: swal fire types
swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "danger",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
Example 4: jquery sweet popup
$.sweetModal.prompt('Can I haz cheezeburger?', 'Can I?', 'Nope', function(val) {
$.sweetModal('You typed: ' + val);
});
Example 5: sweet alert react
import swal from 'sweetalert';
Example 6: jquery sweet popup
$.sweetModal({
title: 'HTML Content',
content: 'You can place <b>anything</b> <i>you</i> want in here.'
});