1# llimphi-widget-toast23Stacked ephemeral notifications.
45Four severities (Info / Success / Warning / Error) with hardcoded semantic
6colours — an Error must read as red even if the app is on the "sunset" theme.
7Each toast carries an icon from `llimphi-icons` and a short text.
89The widget is **render-only**: it receives a list of `Toast`s already filtered by
10the app (those that have not expired) and stacks them in the bottom-right corner.
11The lifecycle (push, auto-dismiss after `duration`, manual dismiss on click) is
12handled by the app from its `update`/`spawn`.
1314Typical pattern:
15161. The app keeps `Vec<Toast>` in the model plus `next_id: u64`.
172. To push: add a Toast with `expires_at = Instant::now() + dur` and
18 `handle.spawn(move || { sleep(dur); Msg::ToastExpire(id) })`.
193. `view_overlay` filters the unexpired ones and passes them to
20 `toast_stack_view`.
2122---
2324Part of **llimphi** — see [llimphi](../../README.md).
README.md
llimphi-widget-toast
Stacked ephemeral notifications.
Four severities (Info / Success / Warning / Error) with hardcoded semantic
colours — an Error must read as red even if the app is on the "sunset" theme.
Each toast carries an icon from llimphi-icons and a short text.
The widget is render-only: it receives a list of Toasts already filtered by
the app (those that have not expired) and stacks them in the bottom-right corner.
The lifecycle (push, auto-dismiss after duration, manual dismiss on click) is
handled by the app from its update/spawn.
Typical pattern:
The app keeps Vec<Toast> in the model plus next_id: u64.
To push: add a Toast with expires_at = Instant::now() + dur and
handle.spawn(move || { sleep(dur); Msg::ToastExpire(id) }).
view_overlay filters the unexpired ones and passes them to
toast_stack_view.