2

This question has been raised for sweetalert 1 Adding class to sweet alert

Now my question is, how can i add a custom class in sweetalert2?

className: "new_class" does not work for me.

Michael H.
  • 79
  • 1
  • 1
  • 11

1 Answers1

7

For sweetalert2 the custom class can be added to multiple targets:

Swal.fire({
  ...
  customClass: {
    container: '...',
    popup: '...',
    title: '...',
    closeButton: '...',
    icon: '...',
    image: '...',
    htmlContainer: '...'
    input: '...',
    inputLabel: '...',
    validationMessage: '...',
    actions: '...',
    confirmButton: '...',
    denyButton: '...',
    cancelButton: '...',
    loader: '...',
    footer: '...'
    timerProgressBar: '...'
  }
})

Docs: https://sweetalert2.github.io/#custom-class

Limon Monte
  • 52,539
  • 45
  • 182
  • 213