You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/src/pages/toast.mdx
+10
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,16 @@ toast('Event has been created', {
178
178
});
179
179
```
180
180
181
+
### Persisting toasts
182
+
183
+
If you want a toast to stay on screen forever, you can set the `duration` to [`Infinity`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity).
184
+
185
+
```js
186
+
toast('This toast will stay on screen forever', {
187
+
duration:Infinity,
188
+
});
189
+
```
190
+
181
191
### Dismissing toasts programmatically
182
192
183
193
To remove a toast programmatically use `toast.dismiss(id)`. The `toast()` function return the id of the toast.
0 commit comments