
SweetAlert2 - a beautiful, responsive, customizable and accessible (WAI ...
Usage 1. Import the plugin: import Swal from 'sweetalert2' // or via CommonJS const Swal = require ('sweetalert2')
SweetAlert2 Recipe Gallery - Code Examples for Specific Tasks
SweetAlert2 Recipe Gallery - Code Examples for Specific Tasks Recipe Gallery A collection of easy-to-digest code examples for specific tasks in about 30 lines of code or less. Queue with Progress Steps …
Yes/No/Cancel Dialog - GitHub Pages
23 import Swal from 'sweetalert2' import './styles.css' Swal. fire({ title: 'Do you want to save the changes?', showDenyButton: true, showCancelButton: true,
Sidebars and Drawers - GitHub Pages
import Swal from 'sweetalert2' ;(async () => { // LEFT SIDEBAR await Swal. fire({ title: 'Left sidebar 👋', position: 'top-start', showClass: {
Draw Attention / Persistent Dialog - GitHub Pages
18 import Swal from 'sweetalert2' import 'animate.css' Swal. fire({ title: 'I will shake when you click outside!', allowOutsideClick: () => { const popup = Swal. getPopup() as HTMLElement
Blurred Backdrop - sweetalert2.github.io
document. body. innerHTML = ` <div>lorem ipsum dolor sit amet consectetur adipisicing elit</div> ` Swal. fire({ title: 'I will blur the document with my backdrop', })
Validation Message with a Custom Icon - GitHub Pages
16 import Swal from 'sweetalert2' import './styles.css' Swal. fire({ title: 'Enter your name', input: 'text', customClass: {
Date input powered by react-day-picker
While it is possible to use input: 'date | datetime-local | time | week | month' directly in Swal.fire (), you can also use any datepicker plugin to provide the consistent look and feel across browsers as well as …
Modal with iframe inside
Modal with iframe inside The best way to show iframes is to use the embed-iframe theme. Import the theme and set it in the swal options:
Internationalization (i18n) and localization (l10n) - GitHub Pages
inputValue: 'fr', didOpen: () => { Swal. getInput()!. addEventListener('change', () => { i18next. changeLanguage(Swal. getInput()!. value) Swal. getTitle()!. innerText = i18next. t('hello') }) },