emilkowalski / sonner

An opinionated toast component for React.

Home Page:https://sonner.emilkowal.ski

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a way to disable auto-dismiss?

TheMikeyRoss opened this issue · comments

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)

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

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