Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

sweet alert 2

npm install sweetalert2

// ES6 Modules or TypeScript
import Swal from 'sweetalert2'

// CommonJS
const Swal = require('sweetalert2')

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)
  }
})



Use 
Toast.fire({
  icon: 'success',
  title: 'Signed in successfully'
})
Source by sweetalert2.github.io #
 
PREVIOUS NEXT
Tagged: #sweet #alert
ADD COMMENT
Topic
Name
1+8 =