Component
Composable toast notifications with stacking, swipe-to-dismiss, and an imperative manager API aligned with Base UI patterns. Wrap your app in Toast.Provider, render a portal + viewport, and map active toasts to Toast.Root.
Click repeatedly to stack. Hover the stack to expand every toast.
Import all parts of the component and piece them together
Wraps your app (or a subtree) and owns toast state, stacking, and the active toast manager.
| Prop | Type | Default |
|---|---|---|
children | ReactNode | -- |
customRootClass | string | '' |
position | string | bottom-right |
expand | boolean | false |
gap | number | 14 |
limit | number | 3 |
maxToasts | number | -- |
timeout | number | 5000 |
toastManager | ToastManager | -- |
Renders toast children into the theme portal root (or document.body).
| Prop | Type | Default |
|---|---|---|
children | ReactNode | -- |
container | HTMLElement | null | theme portal / body |
The notifications region (<ol>) that measures heights, handles hover expand, and positions the stack.
| Prop | Type | Default |
|---|---|---|
children | ReactNode | -- |
className | string | '' |
One toast item (<li>): timers, swipe-to-dismiss, stack transforms, and live region semantics.
| Prop | Type | Default |
|---|---|---|
toast | ToastData | -- |
children | ReactNode | -- |
className | string | '' |
Card wrapper around the toast body; forwards standard div attributes.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
β¦props | HTMLAttributes<HTMLDivElement> | -- |
Primary line of the toast; rendered as a <div> (not a heading) so transient notifications do not add to the page outline.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
β¦props | HTMLAttributes<HTMLHeadingElement> | -- |
Secondary copy for the toast; optional when only a title is shown.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
β¦props | HTMLAttributes<HTMLParagraphElement> | -- |
Optional action button; toast.actionProps are merged first, then your props.
| Prop | Type | Default |
|---|---|---|
type | string | button |
className | string | '' |
children | ReactNode | -- |
β¦props | ButtonHTMLAttributes<HTMLButtonElement> | -- |
Dismiss control; calls the item dismiss handler after any onClick you provide.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | Γ |
onClick | function | -- |
β¦props | ButtonHTMLAttributes<HTMLButtonElement> | -- |
Accessibility
| Shortcut | Description |
|---|---|
Tab | Moves focus through any interactive content inside visible toasts, including action and close buttons. Focusing the viewport expands the stack. |
Shift + Tab | Moves focus to the previous focusable control and keeps the stack expanded while focus remains inside the viewport. |
Enter | Activates the focused Toast.Action or Toast.Close button. |
Space | Activates the focused Toast.Action or Toast.Close button. |
| Reference | What Rad UI follows |
|---|---|
Each Toast.Root uses aria-live with aria-atomic so assistive technologies announce notification updates. High-priority toasts announce assertively; other toasts announce politely. | |
Toast.Action and Toast.Close render native buttons, so activation follows the standard button keyboard model. | |
Toast.Viewport exposes the notifications stack as a labelled region while preserving normal focus movement through interactive toast controls. |
Examples
position on Toast.Provider moves the viewport to each corner or edge.
useToastManager().promise() shows a loading toast, then resolves to success or error.
Pass toastManager={createToastManager()} to keep notifications separate from the default singleton.
Set actionProps on add(); they merge into Toast.Action.
limit caps the visible stack. Extra toasts queue until a slot opens.
expand keeps every toast fully visible β no stacked peek layout.