Keep related content together in a bordered area.
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 card --to ../my-appFiles copied: src/widgets/card.rs, src/widgets/mod.rs
Usage
use amenui::widgets::{card};
fn view() -> El<Msg> {
card("k1", Some("天气"), text("晴,22°", 14.0, Paint::TEXT))
}API
| Functions | card |
|---|---|
| Props | key, title: Option<&str>, body: El<M>. |
| Files | src/widgets/card.rs |
| Depends on | base |
| Response to fronts | inherits (text inside is nudged and legible) |
| Recomposition | keyed labels recompose when their text changes |
Keyboard and accessibility
| States | none of its own. |
|---|---|
| Keys and messages | none; make it pressable with .on_press(m). |
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).
Recipes: A page change with a shared part