emilkowalski / sonner

An opinionated toast component for React.
https://sonner.emilkowal.ski
MIT License
8.37k stars 263 forks source link

a way to disable auto-dismiss? #429

Closed TheMikeyRoss closed 3 months ago

TheMikeyRoss commented 4 months ago

Is there a way to disable the auto-dismiss? I mean I can use an extremely long duration. But I'm using the sonner for cookie consent and I don't want the toast to go away unless the user clicks on "agree" (which will dismiss the toast)

zaaakher commented 4 months ago

As mentioned here, you'll have to use JavaScripts' Infinity (read more)


createSonner("Something", {
    duration: Infinity,
});