Toast
Feedback notification for form submissions, wishlist changes, price alerts, session state, and any async action result. Built on Radix Toast — inherits swipe-to-dismiss, focus management, hotkey-to-focus (F8), and auto-dismiss timing. Five semantic variants map to the platform's status token palette.
Usage notes
- — Mount
ToastProvider+ToastViewportonce at the app shell root. Every subsequentToastrenders into that viewport regardless of where in the tree it lives. - — Variants map to the platform's semantic status palette:
success/destructive/info/warning/default. Colors auto-adapt to dark mode. - —
durationis a per-toast Radix prop; default 5000ms. Set toInfinityfor sticky toasts (e.g. destructive errors requiring user acknowledgement). - —
ToastActionrequires analtText— Radix uses it for the aria-label so screen reader users hear the action even before the visual button appears. - — Swipe-to-dismiss works on touch devices; direction configured via
ToastProvider swipeDirectionprop. - — Follow-up: a
useToast()hook to enable imperativetoast({ title, description, variant })calls without managing open state per call site. Ships in a separate PR once a real consumer needs it.