Skip to content

Commit a8bbd16

Browse files
committed
docs: add ToastCustomOptions interactive component
1 parent 7e1acd7 commit a8bbd16

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

docs/src/content/options.mdx

+25-15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: 'The <Toaster /> component is used to show toasts in your applicati
44
category: 'Customization'
55
---
66

7+
import ToastCustomOptions from '@/components/examples/toastCustomOptions';
8+
79
```tsx
810
import { Toaster } from '@pheralb/toast';
911

@@ -54,7 +56,7 @@ You can change this value using the `font` property. In this case, we are using
5456
/>
5557
```
5658

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)
5860
5961
## Styling
6062

@@ -63,17 +65,25 @@ To customize toasts with personalized styles:
6365
1. Activate the `headless` property.
6466
2. Use the `classNames` property.
6567

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

Comments
 (0)