react-hot-toast
react-hot-toast copied to clipboard
Centering toast in the middle of the screen
I would like to display the toast in the verticle center of the screen, regardless of the screen height. I see that there is a position
prop on the Toaster component, but these focus on Top and Bottom - there is no verticle Center.
I have tried containerStyle={{top: "50%"}}
and containerStyle={{transform: "translateY(50%)"}}
on the Toaster component, but these don't seem to quite center the toast - there is slightly more of a gap at the top than the bottom.
Is there a magic CSS one-liner I am missing? Any help would be appreciated.
I could be wrong, but shouldnt you use translateY(-50%)?
how I could to show the toast in the middle screen with current API of react-hot-toast ?