Sweetalert2
$ npm install sweetalert2
Elegant Eel
$ npm install sweetalert2
Swal.fire({
title: 'Error!',
text: 'Do you want to continue',
icon: 'error',
confirmButtonText: 'Cool'
})
Swal.fire(
'Good job!',
'You clicked the button!',
'failed'
)
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'Signed in successfully'
})
const { value: email } = await Swal.fire({ title: 'Input email address', input: 'email', inputLabel: 'Your email address', inputPlaceholder: 'Enter your email address'})if (email) { Swal.fire(`Entered email: ${email}`)}