Toast
Toast delivers short-lived feedback — saves, uploads, and errors that should not block the UI.
Mount one ToasterProvider near your app root, then call ToasterInjection::dispatch with ToastOptions or a composed Toast view. Stack position, timeout (default 8000 ms), queue limit, and hover-pause are provider defaults; override per toast when needed. ToasterInjection::dismiss_all clears only the nearest provider's toasts.
- Confirmations that auto-dismiss (saved, copied, uploaded)
- Errors with optional retry or undo in the footer
- Non-blocking feedback while the user keeps working
Prefer MessageBar for persistent page or section status. Prefer Field validation for errors tied to a single form control.
- Wrap your app shell in a single
ToasterProvider. - From any descendant, call
ToasterInjection::expect_context().dispatch(ToastOptions::new("…")). - Set
intent,timeout, orpositiononToastOptions; usetimeout(-1)for persistent toasts. - For full slot control, pass
ToastOptions::composed(|| view! { … })withToastTitle,ToastBody, and optionalToastFooter. - Dismiss by id with
dismiss, or clear the provider stack withdismiss_all(scoped to that provider only).
Compose title, body, and optional footer for inline documentation or layout previews without dispatching.
Mount ToasterProvider and dispatch toasts via ToasterInjection::dispatch. Set intent to apply semantic background and border tokens from the theme.
Success toasts use green semantic tokens for completed actions.
Error toasts can include a footer action for retry or undo. Use ToastOptions::footer_action_callback when the action should run custom logic.
Retries: 0
Stack toasts in the bottom-end corner for non-blocking notifications.
Override auto-dismiss duration per toast. Negative values keep the toast until dismissed.
Toasts with a negative timeout stay until explicitly dismissed.
Dispatch with a known id, then dismiss imperatively.
Clear every visible and queued toast for this provider. Other preview examples on the catalog page use separate providers, so their toasts are not affected.
Footer actions that dismiss use ToastTrigger under the hood.
Same slot-based composition as static <Toast>, dispatched via ToastOptions::composed.
Dispatch with ToastTitle, ToastBody, and ToastFooter slots. Uses the provider default auto-dismiss timeout (8000ms).
Adjust viewport inset (px from the stack edge). Position defaults to bottom-end; offset only changes how far the stack sits from the viewport edge.
Hovering pauses the dismiss timer until the pointer leaves.
Extra toasts queue until a visible toast is dismissed.
Render toasts inside a positioned container instead of a portal.
Dispatch toasts to each stack position, including per-toast overrides.