I recently integrated SweetAlert2's toast notifications into my web application and customized the animation using the customClass
parameter to have the notification slide in from the right side. However, there are a couple of things I'm struggling to figure out:
How can I speed up the notification animation? Currently, it takes around 2 seconds for the notification to slide in, but I want it to be faster, almost instant. I am only familiar with the
timer
property that controls how long the notification is visible.Is there a way to make the toast notification slide in beneath my top navigation bar? Can I adjust the top offset or margin to specify where the notification should start from? For example, setting the top of the notification to a specific value like
100px
from the top of the screen.
Here is a snippet of my current code:
const toast = swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 10000,
animation: false,
customClass: 'animated slideInRight'
});