Capítulo 34 de 43
A succinct, auto-dismissing notification, rendered into a fixed viewport, with built-in pause-on-hover/focus/window-blur, swipe-to-dismiss, and a keyboard hotkey to jump to the notification region.
Provider (wraps the app) → Viewport (fixed notification region) + one or more Root (→ Title, Description, Action, Close).Root is not for content requiring a response: it auto-closes; use AlertDialog/Dialog instead for anything that needs to hold the user's attention until they act.Provider's swipeDirection/swipeThreshold plus Root's onSwipeStart/Move/End/Cancel and the --radix-toast-swipe-move-x/y CSS variables drive touch-dismiss gestures and their animation.Viewport's hotkey (default ["F8"]): lets keyboard users jump focus straight to the notification region — you're responsible for surfacing hotkey discoverability (e.g. in the label).Root's default duration (5000ms from Provider, overridable per-Root) and multiple simultaneous toasts are supported natively.| Part | Notable props |
|---|---|
Provider | duration (default 5000), label* (default "Notification"), swipeDirection, swipeThreshold |
Root | type ("foreground"/"background" — affects screen-reader announcement priority), duration, open/onOpenChange, onPause/onResume, swipe callbacks |
Toast — it auto-dismisses; use Action for a convenience shortcut (e.g. "Undo"), not the sole way to complete a flow.type="background" vs the default "foreground" controls assistive-tech announcement urgency — use "foreground" sparingly, for genuinely important messages.Root) is documented separately — most real apps wrap this primitive in a small toast-manager hook.