sweet alert add class to confirm button code example

Example 1: swal change confirm button class

Swal.fire({
    title: 'example text',
    buttonsStyling: false,
    customClass: {
    	confirmButton: 'example-class' //insert class here
    }
})

Example 2: sweetalert confirm box

swal({  title: "Are you sure?",  text: "Once deleted, you will not be able to recover this imaginary file!",  icon: "warning",  buttons: true,  dangerMode: true,}).then((willDelete) => {  if (willDelete) {    swal("Poof! Your imaginary file has been deleted!", {      icon: "success",    });  } else {    swal("Your imaginary file is safe!");  }});

Tags:

Misc Example