Skip to main content
The Toast component displays temporary notification messages to users with support for different types, positions, and stacking behavior.

Installation

Usage

Toast Manager

toastManager.add()

string
Toast title text.
string
Toast description/body text.
string
Toast type. Options: default, success, info, warning, error, loading
number
default:"5000"
Duration in milliseconds before auto-dismiss.
object
Action button configuration: { children: ReactNode, onClick: () => void }

ToastProvider Props

string
default:"bottom-right"
Toast position on screen.Options: top-left, top-center, top-right, bottom-left, bottom-center, bottom-right
number
default:"5000"
Default duration for all toasts.
number
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