yarn sweetalert2 9.0.0
v9.0.0

latest releases: 11.11.0, 11.10.8, 11.10.7...
4 years ago

🔴 Breaking change # 1 - rename type to icon

Swal.fire({
- type: 'success'
+ icon: 'success'
  ...
})

🔴 Breaking change # 2 - Deprecated API params were removed:

  • customContainerClass
  • confirmButtonClass
  • cancelButtonClass
  • imageClass
  • inputClass

Use customClass instead: https://sweetalert2.github.io#custom-class

🔴 Breaking change # 3 - Deprecated API methods were removed:

  • disableConfirmButton() (use Swal.getConfirmButton().setAttribute('disabled', '') instead)
  • enableConfirmButton() (use Swal.getConfirmButton().removeAttribute('disabled') instead)
  • setProgressSteps() (use Swal.update({ progressSteps: ... }) instead)
  • showProgressSteps() (use Swal.getProgressSteps() instead)
  • hideProgressSteps() (use Swal.getProgressSteps() instead)

🔴 Breaking change # 4

Cancel buttons isn't getting disabled automatically when showing loader (Swal.showLoader())


🎉 NEW FEATURES

🎉 showClass and hideClass

Now, it's possible to change showing/hiding animations of popups:

Swal.fire({
  ...
  showClass: {
    popup: '...',
    backdrop: '...',
    icon: '...',
  },
  hideClass: {
    popup: '...',
    backdrop: '...',
    icon: '...',
  },
  ...
})

The animation param was deprecated, use showClass: { popup: '', icon: '', backdrop: '' } instead.

🎉 iconHtml

Use any HTML inside icons (e.g. Font Awesome)

Swal.fire({
  ...
  icon: 'success'
  iconHtml: '<i class="far fa-thumbs-up"></i>'
  ...
})

The .swal2-arabic-question-mark class was removed, use iconHtml: '؟' instead.

Don't miss a new sweetalert2 release

NewReleases is sending notifications on new releases.