Installation
Usage
Toast Manager
toastManager.add()
Toast title text.
Toast description/body text.
Toast type. Options:
default, success, info, warning, error, loadingDuration in milliseconds before auto-dismiss.
Action button configuration:
{ children: ReactNode, onClick: () => void }ToastProvider Props
Toast position on screen.Options:
top-left, top-center, top-right, bottom-left, bottom-center, bottom-rightDefault duration for all toasts.
Maximum number of visible toasts.
Toast Types
- default: Standard toast
- success: Success message with check icon
- info: Information message with info icon
- warning: Warning message with alert icon
- error: Error message with error icon
- loading: Loading state with spinner
Examples
Success Toast
Error Toast
With Action Button
Loading Toast
Custom Duration
Different Positions
Accessibility
- Built on @base-ui/react Toast primitive
- ARIA live region announcements
- Keyboard dismissible (Escape or swipe)
- Focus management
- Swipe to dismiss support
- Screen reader compatible