Toast
A short message that slides in at an edge of the screen and leaves on its own: toast() queues one and a Toaster shows it, at the bottom centre by default.
Usage
Examples
Border radius
borderRadius sets a toast's corners on the kit's one scale: none, xs 4px, sm 6px, base 8px, lg 12px (the default) or xl 16px; each button shows its own toast.
Types
toast.success, toast.info, toast.warning and toast.destructive mark a toast with a coloured icon, toast.promise spins until its promise settles, and toast() alone has no icon.
Description
description sets a quieter line under the title, where by default a toast is its title alone.
Action
action sets a small outline button at the toast's end that closes it once clicked, where by default a toast has none.
Side
side puts a toast at the top or the bottom edge of the screen, the bottom by default, the Toaster's for every toast unless one picks its own.
Align
align sets a toast at the start, the middle or the end of its edge, the middle by default, the Toaster's for every toast unless one picks its own.
Duration
duration is how many milliseconds a toast stays, 5000 by default, and Infinity keeps it until it is closed; hovering it pauses the count.
Id
id names a toast, so another with the same id replaces it in place, where by default each new toast stacks under the last.
API Reference
Toast
ToastProps · components/Toast/Toast.types.tsToastProvider
ToastProviderProps · takes the props of Radix Toast.ProviderToastViewport
ToastViewportProps · also takes the props of Radix Toast.ViewportToastTitle
ToastTitleProps · takes the props of Radix Toast.TitleToastDescription
ToastDescriptionProps · takes the props of Radix Toast.DescriptionToastAction
ToastActionProps · also takes the props of Radix Toast.ActionToastClose
ToastCloseProps · takes the props of Radix Toast.CloseToaster
ToasterPropsIt also takes the props of Radix Toast.Root.