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
| Choice | Type | Meaning | Notes / default behavior |
|---|---|---|---|
Info | ToastKind | Neutral informational update. | Good for short confirmations or status notes. |
Success | ToastKind | Positive completion or confirmation. | Good when the user should feel closure after a task. |
Warning | ToastKind | Something deserves attention soon. | Use sparingly because toasts disappear quickly. |
Error | ToastKind | Something 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.