Skip to content

Commit

Permalink
[Docs]: Render toast on page load (#363)
Browse files Browse the repository at this point in the history
* [Docs]: Add render toast on page load

* fix typo
  • Loading branch information
luis-viegas authored Mar 10, 2024
1 parent c7740f7 commit 6b37985
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 @@ -27,6 +27,16 @@ toast('My toast', {
});
```

### Render toast on page load

To render a toast on initial page load it is required that the function `toast()` is called inside of a `setTimeout` or `requestAnimationFrame`.

```jsx
setTimeout(() => {
toast('My toast on a page load');
})
```

## Creating toasts

### Success
Expand Down

0 comments on commit 6b37985

Please sign in to comment.