Switch between groups of content in the same place.
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 tabs --to ../my-appFiles copied: src/widgets/tabs.rs, src/widgets/mod.rs
Usage
use amenui::widgets::{tabs};
fn view() -> El<Msg> {
tabs("t1", &["概览", "设置"], 0, 18.0, 2.0, Msg::Pick, text("概览的内容", 13.0, Paint::TEXT))
}API
| Functions | tabs |
|---|---|
| Props | key, labels, current, gap, mark (underline thickness), msg, panel (the current one). |
| Files | src/widgets/tabs.rs |
| Depends on | base |
| 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 | current tab underlined; one focus stop, Left / Right move. |
|---|---|
| Keys and messages | msg(i); tabs are keyed key:i. |
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).