A brief notice in a corner that goes away by itself.
Installation
Components are distributed as source. Copy it and what it depends on into your project, then change it as you need:
cargo run --release --bin amenui -- add toast --to ../my-appFiles copied: src/widgets/toast.rs, src/widgets/mod.rs, src/widgets/button.rs
Usage
use amenui::widgets::{toast};
fn view() -> El<Msg> {
col().width(380.0).height(110.0).child(toast("to1", "已保存", "三项改动已写入", true, Msg::Nothing))
}API
| Functions | toast |
|---|---|
| Props | key, title, body, shown, dismiss (its close button). |
| Files | src/widgets/toast.rs |
| Depends on | base, button |
| Response to fronts | nudge (a control: pushed as one piece by fronts, held and condensing at most to Look::legible_cap) |
| Recomposition | keyed labels recompose when their text changes |
Keyboard and accessibility
| States | hidden, shown (at the window's bottom right, polite live region). |
|---|---|
| Keys and messages | dismiss on its close button; the application hides it after a few seconds (Ui::on_wake). |
On the web every control is mirrored into the page as an element with its role and name, so screen readers and the browser's own focus see it (DESIGN.md §1.14).