Toast

Notification toast system with stacking, auto-dismiss, pause on hover, and variant-based roles.

Example

Props

NameTypeDefaultRequiredDescription
position'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''top-right'NoContainer position (on ToastProvider)
maxToastsnumber5NoMaximum visible toasts (on ToastProvider)
messagestringRequiredToast message (in toast() options)
descriptionstringNoSecondary text (in toast() options)
variant'info' | 'success' | 'warning' | 'danger''info'NoToast color variant (in toast() options)
durationnumber5000NoAuto-dismiss delay in ms. 0 = persistent (in toast() options)

Accessibility

  • Container: role="region" with aria-label="Notifications" and aria-live="polite"
  • Info/success toasts: role="status"
  • Warning/danger toasts: role="alert"
  • Dismiss button: aria-label="Dismiss notification"
  • Timers pause on hover for reading time

Related Tokens

--toast-z-index--toast-radius--toast-shadow--toast-info--toast-success--toast-warning--toast-danger