TrademarkTrademark
Docs
Ctrl k
Search docs...
Components

Toast

Updated: October 18, 2026
View on GitHub
Soon
Not released yet. This is on main and is not in any published version yet. It will not install today.

A toast is a short message on a surface card that hides itself after six seconds. Wrap the app in ToastProvider, then call addToast({ variant, message }) from useToast anywhere under it, as on the web. See the web Toast for the same component in the browser.

Setup

Put ToastProvider inside ThemeProvider, around the rest of the app. It draws the toasts above everything in it, stacked at the bottom of the screen with the newest last.

Add a toast

variant sets the icon: success, danger, warning or info. Each toast has a close button.

Action and duration

action adds an element before the close button, such as an undo button. duration is in milliseconds; Infinity keeps the toast until it is closed.

A single toast

Toast also renders on its own, where you place it. It hides itself after duration and calls onClose. Without onClose it has no close button.

Differences from the web

  • useToast throws outside a ToastProvider.
  • Toasts sit above the home indicator when the safe-area insets are passed to ThemeProvider, as shown on the overview.
  • A danger toast is announced right away; the others wait for the screen reader to finish.

API reference

useToast

Field
Type
Description
addToast(toast: ToastOptions) => voidShows a toast.
removeToast(id: string) => voidHides a toast by its id.
toasts(ToastOptions & { id: string })[]The toasts on screen.

ToastOptions

Prop
Type
Default
Description
variant"success" | "danger" | "warning" | "info"Sets the icon and how it is announced. Required.
messageReactNodeThe text. Required.
actionReactNodeAn element before the close button.
durationnumber6000Milliseconds before the toast hides itself. Infinity keeps it.

Toast

Prop
Type
Default
Description
variant"success" | "danger" | "warning" | "info"Sets the icon and how it is announced. Required.
childrenReactNodeThe text. Required.
showIconbooleantrueShows the variant's icon.
onClose() => voidShows a close button. Also called when the toast hides itself.
actionReactNodeAn element before the close button.
durationnumber6000Milliseconds before the toast hides itself. Infinity keeps it.
styleViewStyleStyle for the card.

ToastProvider

Prop
Type
Default
Description
childrenReactNodeThe app. Required.
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club