Overview
🔔✕
Settings saved
✓✕
Payment successful
Receipt sent to your email.
⚠✕
Storage almost full
Free up space to continue syncing.
✕✕
Upload failed
The file size exceeds the 10 MB limit.
Installation
Setup
Add<ToastProvider> and <Toaster> to your app root once:
Usage
Variants
Default
🔔
Settings saved
✕With Description
Success
✓✕
Payment successful
Receipt sent to your email.
Warning
Error
With Action
🔔
Message deleted
✕API Reference
toast()
Primary notification message (required).
Supporting description shown below the title.
Semantic color variant. Values:
default · success · warning · error · infoAuto-dismiss delay in milliseconds.
Optional action element (e.g. an Undo button).
Toaster
Stack position on screen. Values:
top-left · top-center · top-right · bottom-left · bottom-center · bottom-rightAccessibility
- Toast uses
role="status"(orrole="alert"for error variant) so screen readers announce it aria-live="polite"is used for non-critical toasts;aria-live="assertive"for errors- Auto-dismiss is paused when the user hovers or focuses the toast
- Action buttons inside toasts are keyboard-navigable
- Dismiss button has an
aria-label="Close"for screen readers
Do’s & Don’ts
Do
- Use Toast for transient feedback after user actions (save, delete, upload)
- Keep the title short — one sentence or fewer
- Include an action when the user may want to undo
- Use
variant="error"for failures that need immediate attention
Don't
- Don’t use Toast for persistent alerts — use Alert component instead
- Don’t stack more than 3 toasts simultaneously
- Don’t use Toast for information that requires a user decision — use Modal
- Don’t make the duration too short for toasts with descriptions (use ≥5s)