SweetAlert2
$ npm install sweetalert2
Elegant Eel
$ npm install sweetalert2
npm install sweetalert2
Swal.fire(
'Data Add Successfully!',
'You clicked the button!',
'success'
)
Swal.fire(
'Good job!',
'You clicked the button!',
'failed'
)
Swal.fire({
title: '<strong>HTML <u>example</u></strong>',
icon: 'info',
html:
'You ccccc can use <b>bold text</b>, ' +
'<a href="//sweetalert2.github.io">links</a> ' +
'and other HTML tags',
showCloseButton: true,
showCancelButton: true,
focusConfirm: false,
confirmButtonText:
'<i class="fa fa-thumbs-up"></i> Great!',
confirmButtonAriaLabel: 'Thumbs up, great!',
cancelButtonText:
'<i class="fa fa-thumbs-down"></i>',
cancelButtonAriaLabel: 'Thumbs down'
})
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}`)}
Best alert library in javascript for me
:)
npm install sweetalert2 --save