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 widget: Widget = Toast {
    id: WidgetId::explicit("sync_done_toast"),
    kind: ToastKind::Success,
    message: "Synced 12 files".into(),
    on_close: Some(dismiss_toast_action),
}
.into();

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.

Production checklist

For ToastKind, review the fields that change behavior before treating the widget as finished: Info, Success, Warning, Error. The goal is to make the product rule visible in state and actions, not hidden inside ad-hoc construction code.
If this widget appears inside an interactive flow, keep the surrounding action binding in the parent component and test that the flow still has one clear reducer path.
Check the semantics tree for the user-facing label or role that makes this widget understandable without relying only on pixels.
Add at least one component or harness test that confirms the visible text, semantic role, action dispatch, and layout constraint that matter for this widget in context.
If a screen starts repeating the same ToastKind setup, extract a named component around this widget. That keeps the reference API small while making product code easier to read and safer for generated code to copy.
Toast, AlertKind, Alert, and Badge.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.7.0