✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦
MIT License
Bot releases are hidden (Show)
Published by limonte almost 5 years ago
type
to icon
Swal.fire({
- type: 'success'
+ icon: 'success'
...
})
customContainerClass
confirmButtonClass
cancelButtonClass
imageClass
inputClass
Use customClass
instead: https://sweetalert2.github.io#custom-class
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)Cancel buttons isn't getting disabled automatically when showing loader (Swal.showLoader()
)
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.