SweetAlert2 Notifications

O SweetAlert2

SweetAlert2 je krásna, responzívna, prispôsobiteľná a prístupná náhrada za JavaScript popup okná. Nahradí natívne alert(), confirm() a prompt() funkcie.

Základné notifikácie
Potvrdzujúce dialógy
Vstupné dialógy
Pokročilé funkcie
Server-side integrácia

Príklady odoslania formulárov s SweetAlert2 potvrdením:

Príklady kódu
Základný Success alert:
Swal.fire({
    icon: 'success',
    title: 'Úspech!',
    text: 'Operácia bola úspešne dokončená.'
});
Confirmation dialóg:
Swal.fire({
    title: 'Naozaj zmazať?',
    text: "Túto akciu nebude možné vrátiť späť!",
    icon: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#d33',
    cancelButtonColor: '#3085d6',
    confirmButtonText: 'Áno, zmazať!',
    cancelButtonText: 'Zrušiť'
}).then((result) => {
    if (result.isConfirmed) {
        // Perform deletion
    }
});
Toast notifikácia:
const Toast = Swal.mixin({
    toast: true,
    position: 'top-end',
    showConfirmButton: false,
    timer: 3000,
    timerProgressBar: true
});

Toast.fire({
    icon: 'success',
    title: 'Uložené úspešne'
});