Toast
Toast notifications built on Radix UI Toast primitives. Provides non-intrusive feedback messages that appear temporarily and can be dismissed.
Basic Toast
Preview
Variants
Preview
With Action
Preview
Toast Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "success" | "warning" | "destructive" | "default" | Visual style variant of the toast. |
| duration | number | 5000 | Auto-dismiss duration in milliseconds. |
| open | boolean | - | Controlled open state of the toast. |
| onOpenChange | (open: boolean) => void | - | Callback when the open state changes. |
Sub-Components
| Prop | Type | Default | Description |
|---|---|---|---|
| ToastProvider | component | - | Wraps the toast system. Place once at the root of your app. |
| ToastViewport | component | - | Renders the toast container. Place inside the provider, typically at app root. |
| ToastTitle | component | - | Title text for the toast notification. |
| ToastDescription | component | - | Description text for the toast notification. |
| ToastAction | component | - | Action button rendered inside the toast. Requires altText prop for accessibility. |
| ToastClose | component | - | Close button with an X icon. Appears on hover by default. |
Accessibility
- Built on Radix UI Toast which uses
role="status"andaria-live="polite"for screen reader announcements ToastActionrequires analtTextprop that describes the action for screen readers- Toasts support swipe-to-dismiss on touch devices
- Focus management is handled automatically by the Radix primitives
ToastCloserenders a close button accessible via keyboard