Skip to content

Instantly share code, notes, and snippets.

@deyvicode
Last active March 18, 2021 18:10
Show Gist options
  • Save deyvicode/3b52e819fa4b0c9ec4d18d2a8c231496 to your computer and use it in GitHub Desktop.
Save deyvicode/3b52e819fa4b0c9ec4d18d2a8c231496 to your computer and use it in GitHub Desktop.
Config toast alert for SweetAlert 2 #SweetAlert #Toast
// you need import sweetalert 2 library
function toast(message, type = 'success', timer = '2500', position = 'bottom-end') {
const Toast = Swal.mixin({
toast: true,
position: position,
showConfirmButton: false,
timer: timer
})
Toast.fire({
type: type,
title: message
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment