Skip to main content

Toast

Toast is the transient notification surface.

Use it when the app needs to acknowledge something quickly without interrupting the main task flow. Good examples are "Message sent", "Copied", or "Upload failed" when the full context already exists elsewhere on screen.

Example

use fission::prelude::*;

let node = Toast {
id: WidgetNodeId::explicit("reply_sent_toast"),
kind: ToastKind::Success,
message: "Reply sent".into(),
on_close: Some(dismiss_reply_sent_toast_action),
}
.build(ctx, view);

Field table

FieldTypeMeaningNotes / default behavior
idWidgetNodeIdStable toast identity.Present in the public struct, but the checked-in widget does not currently use it internally. It is still useful in surrounding app state and overlay lists.
kindToastKindSeverity and visual tone of the message.Required. Controls icon and accent treatment.
messageStringMain toast text.Required. Keep it short.
on_closeOption<ActionEnvelope>Action fired when the close button is pressed.Defaults to None.

Lifecycle guidance

The checked-in toast is a visual surface only. It does not auto-dismiss itself. Your app decides when it appears and when it leaves state. If you want timed dismissal, trigger that with an explicit timer or service-driven flow rather than expecting the widget to manage its own lifetime.

Also remember that a toast is not a good place for dense recovery instructions. If the user needs to read, compare, or act carefully, an inline alert or dialog is usually the better fit.

ToastKind, Alert, Modal, and Resources and async.