use fission::prelude::*;
fission_component! {
pub ReplySentNotice<()> {
props { dismiss: ActionEnvelope }
}
view(notice, _state, cx) =>
Toast(
id: WidgetId::explicit("reply.sent"),
kind: ToastKind::Success,
message: cx.tr("reply.sent"),
on_close: notice.dismiss.clone(),
duration: ToastDuration::Default,
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | WidgetId | Stable toast identity. | Retains motion and the independent dismissal timer; use a distinct id per concurrent notification. |
kind | ToastKind | Severity and visual tone of the message. | Required. Controls icon and accent treatment. |
message | String | Main toast text. | Required. Keep it short. |
on_close | Option<ActionEnvelope> | Action fired by close and elapsed duration. | The parent removes the toast; the widget does not mutate the list. |
duration | ToastDuration | Automatic close-request timing. | Default is 5 seconds, Millis(ms) overrides it, Persistent disables the timer. |
motion | Option<ToastMotion> | Entry/exit motion. | None follows standard widget motion. |