Skip to content

Commit

Permalink
chore(docs): include a section about persisting toasts (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaakher committed Jun 8, 2024
1 parent dbbfa22 commit 639ff35
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/src/pages/toast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ toast('Event has been created', {
});
```

### Persisting toasts

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).

```js
toast('This toast will stay on screen forever', {
duration: Infinity,
});
```

### Dismissing toasts programmatically

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

0 comments on commit 639ff35

Please sign in to comment.