Show a picture at its own aspect ratio.
A loosened picture turns into marks; under the pointer it loosens nearby.
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 image --to ../my-appFiles copied: src/widgets/image.rs, src/widgets/mod.rs
Usage
use amenui::widgets::{image};
fn view() -> El<Msg> {
image("im1", amenui::pictures::SKY, 0.6, 0, Some("天空"))
}API
| Functions | image |
|---|---|
| Props | key, id (picture id), ratio (height / width), slot (Markr set for its marks), caption. |
| Files | src/widgets/image.rs |
| Depends on | base |
| Response to fronts | loosen (decoration) |
| Recomposition | keyed labels recompose when their text changes |
Keyboard and accessibility
| States | rest; loosens into its marks under fronts and the lens. |
|---|---|
| Keys and messages | none. |
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).