Skip to main content

ToastKind

ToastKind is the severity enum used by Toast.

A toast is brief, so the kind has to do a lot of work quickly. It helps the user judge whether the message is informative, positive, cautionary, or a failure.

Example

use fission::prelude::*;

let node = Toast {
id: WidgetNodeId::explicit("sync_done_toast"),
kind: ToastKind::Success,
message: "Synced 12 files".into(),
on_close: Some(dismiss_toast_action),
}
.build(ctx, view);

Choice table

ChoiceTypeMeaningNotes / default behavior
InfoToastKindNeutral informational update.Good for short confirmations or status notes.
SuccessToastKindPositive completion or confirmation.Good when the user should feel closure after a task.
WarningToastKindSomething deserves attention soon.Use sparingly because toasts disappear quickly.
ErrorToastKindSomething failed.Best when the failure can be explained briefly and the user can recover elsewhere.

Specific advice

Reserve error toasts for failures that are still understandable in a short overlay. If recovery steps need more room, an inline alert usually serves users better.

Toast, AlertKind, Alert, and Badge.