Toast
Temporary notification toasts
Lightweight toast notifications for user feedback.
Setup
Wrap your app with the toast provider:
Usage
use the useToast hook to trigger notifications:
Types
Info
Success
Warning
Error
Custom duration
Toasts auto-dismiss after 3 seconds by default:
Manual dismiss
use remove to dismiss a toast early:
Props
Toast
| prop | type | default | description |
|---|---|---|---|
| message | string | required | Notification text |
| type | "info" | "success" | "warning" | "error" | required | Toast style |
| duration | number | 3000 | Auto-dismiss time in ms |
UseToast
| property | type | description |
|---|---|---|
| toasts | Toast[] | Current active toasts |
| add | (toast) => void | Show a new toast |
| remove | (id) => void | Dismiss a toast |