Skip to content

Commit f9b4896

Browse files
author
Jostein Kringlen
committed
docs: add warn to documentation site
1 parent 10da76b commit f9b4896

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

site/components/sections/toast-example.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ const examples: Array<{
2727
toast.error("This didn't work.");
2828
},
2929
},
30+
{
31+
title: 'Warning',
32+
emoji: '⚠️',
33+
snippet: "toast.warn('Roadblocks ahead')",
34+
action: () => {
35+
toast.warn('Roadblocks ahead');
36+
},
37+
},
3038
{
3139
title: 'Promise',
3240
emoji: '⏳',

site/pages/docs/styling.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ You can style your notifications globally with the `toastOptions` inside the Toa
4141
background: 'red',
4242
},
4343
},
44+
warn: {
45+
style: {
46+
background: 'yellow',
47+
},
48+
},
4449
}}
4550
/>
4651
```

site/pages/docs/toast.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ toast.error('This is an error!');
6565

6666
Creates a notification with an animated error icon. It can be themed with the `iconTheme` option.
6767

68+
### Warning
69+
70+
```js
71+
toast.warn("I'm warning you!");
72+
```
73+
74+
Creates a notification with an animated warning icon. It can be themed with the `iconTheme` option.
75+
6876
### Custom (JSX)
6977

7078
```js
@@ -132,6 +140,7 @@ Every type has its own duration. You can overwrite them `duration` with the toas
132140
| `blank` | 4000 |
133141
| `error` | 4000 |
134142
| `success` | 2000 |
143+
| `warn` | 3000 |
135144
| `custom` | 4000 |
136145
| `loading` | Infinity |
137146

site/pages/docs/toaster.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ These will act as default options for all toasts. See [`toast()`](/docs/toast) f
7272

7373
#### Type specific options
7474

75-
You can change the defaults for a specific type by adding, `success: {}`, `error: {}`, `loading: {}` or `custom: {}`.
75+
You can change the defaults for a specific type by adding, `success: {}`, `error: {}`, `loading: {}`, `warn: {}` or `custom: {}`.
7676

7777
## Using a custom render function
7878

0 commit comments

Comments
 (0)