Toast
The Toast component provides non-blocking notification messages that appear temporarily to give feedback about an operation or event. Title and body each accept full
<Text> props via titleProps / bodyProps — also forwarded by every useToast() shortcut.Examples
(9)Properties
(46)Playground
Basic Usage
Call
toast.success with a title, message, and optional autoHide value to show a standard confirmation toast.Positions
Set the
position option to anchor the toast stack to any corner or edge of the viewport.Visual Variants
Use the
variant prop to control the toast surface: filled (solid color with auto-contrast text), outline (surface with a full colored border), or light (subtle surface with a colored left accent). Combine it with any color or severity helper.Size Tokens
The
size prop supports the full seven-token scale (xs, sm, md, lg, xl, 2xl, 3xl) and scales padding, title and body typography, the leading icon, action buttons, and the close button together. A number is read as the title font size and scales the rest proportionally. Set defaultSize on ToastProvider to change the default for every toast.Severity Helpers
Use
toast.success, toast.warning, toast.error, and toast.info to render consistent styling and icons for each severity.Interactive Features
Add
actions, toggle persistent, or shorten autoHide to tailor toast interactions for acknowledgements, warnings, and ephemeral notices.Stacking
Toasts at the same position form a stack. The newest one always takes the slot against the anchored edge and the rest move out of its way; when one is dismissed, the toasts behind it slide into the gap while it fades. Hovering — or tabbing into — any toast pauses the countdown on the whole stack, and resumes it with the time that was left.
limit caps how many are on screen at once, retiring the oldest with its normal exit rather than deleting it.Enhanced Features
Combine swipe gestures, custom
animationConfig, batch helpers, and toast.promise to coordinate rich toast experiences.Text customization
titleProps and bodyProps accept any <Text> props (ff, weight, size, color, style…) and apply them to the toast title and body slots. Useful for matching toast typography to your brand.Scan to open this page on your phonereact-ui-library.com/components/Toast
</>
react-ui-library
100+ accessible, themeable components that work seamlessly across iOS, Android, and Web.
A Platform Blocks product.
Quick Links
Resources