tawasuyu

tawasuyu/llimphi

Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.

Rust 660Markdown 302TOML 157RON 312382 Sutichaykuna

⎇ main widgets/toast/README.md Markdown · 24 siq'ikuna · 936 B Ñawpa willay ch'uya

chore: refresco desde el monorepo — 27 crates nuevos (anim, lottie, svg, mesh, image, layer, test, wire-view, widgets rag-sidebar/router/lazy-list/rive-button) y sync de los 95 existentes 93253cc22 · Sergio ·

1# llimphi-widget-toast
2
3Stacked ephemeral notifications.
4
5Four 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.
8
9The 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`.
13
14Typical pattern:
15
161. 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`.
21
22---
23
24Part 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:

  1. The app keeps Vec<Toast> in the model plus next_id: u64.
  2. To push: add a Toast with expires_at = Instant::now() + dur and handle.spawn(move || { sleep(dur); Msg::ToastExpire(id) }).
  3. view_overlay filters the unexpired ones and passes them to toast_stack_view.

Part of llimphi — see llimphi.