@@ -4,6 +4,8 @@ description: 'The <Toaster /> component is used to show toasts in your applicati
4
4
category : ' Customization'
5
5
---
6
6
7
+ import ToastCustomOptions from ' @/components/examples/toastCustomOptions' ;
8
+
7
9
``` tsx
8
10
import { Toaster } from ' @pheralb/toast' ;
9
11
@@ -54,7 +56,7 @@ You can change this value using the `font` property. In this case, we are using
54
56
/>
55
57
```
56
58
57
- > 💡 To modify the icon of a ** single** toast: [ `` toast - Custom Icon ` `] ( /toast#custom-icon )
59
+ > 💡 To modify the icon of a ** single** toast: [ ` toast - Custom Icon ` ] ( /toast#custom-icon )
58
60
59
61
## Styling
60
62
@@ -63,17 +65,25 @@ To customize toasts with personalized styles:
63
65
1 . Activate the ` headless ` property.
64
66
2 . Use the ` classNames ` property.
65
67
66
- ``` tsx
67
- <Toaster
68
- toastOptions = { {
69
- headless: true ,
70
- classNames: {
71
- toast: ' ' ,
72
- container: ' ' ,
73
- icon: ' ' ,
74
- content: ' ' ,
75
- actions: ' ' ,
76
- },
77
- }}
78
- />
79
- ```
68
+ <ToastCustomOptions client :load />
69
+
70
+ ## API Reference
71
+
72
+ - ` toastOptions ` from [ ` <Toaster /> ` ] ( /toaster#api-reference ) accepts the following properties:
73
+
74
+ | Property | Description | Type | Required |
75
+ | ------------ | --------------------------------------------------------------- | ---------------------------- | -------- |
76
+ | ` font ` | Font for all toasts | ` string ` | - |
77
+ | ` icons ` | Icons for all toasts | ` Record<Variant, ReactNode> ` | - |
78
+ | ` headless ` | Disable all default styles. It works together with ` classNames ` | ` boolean ` | - |
79
+ | ` classNames ` | Custom styles for all toasts | ` ToastClassnames ` | - |
80
+
81
+ - ` classNames ` from ` toastOptions ` accepts the following properties:
82
+
83
+ | Property | Description | Type | Required |
84
+ | ----------- | ------------------------------------- | -------- | -------- |
85
+ | ` toast ` | Global toast style | ` string ` | ✅ |
86
+ | ` container ` | Toast container styles | ` string ` | ✅ |
87
+ | ` icon ` | Styles for the main icon of the toast | ` string ` | ✅ |
88
+ | ` content ` | Styles for title and description | ` string ` | ✅ |
89
+ | ` actions ` | Styles for the buttons | ` string ` | ✅ |
0 commit comments