Skip to content

Commit 639ff35

Browse files
authored
chore(docs): include a section about persisting toasts (#430)
1 parent dbbfa22 commit 639ff35

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

website/src/pages/toast.mdx

+10
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ toast('Event has been created', {
178178
});
179179
```
180180

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+
181191
### Dismissing toasts programmatically
182192

183193
To remove a toast programmatically use `toast.dismiss(id)`. The `toast()` function return the id of the toast.

0 commit comments

Comments
 (0)