Fusuma

Components / Layout

show

view while when is true, nothing (and no room) while it is false.

Try it

This is the Long list page of the gallery, running in your browser: show is on it, and it is the real widget. Press Run, then use it.

Live: Long list, where show is usedOpen full size

Also on this pagevirtual_rows

view while when is true, nothing (and no room) while it is false.

While when is false the view is still in the tree but hidden: it takes no room and is not drawn, and what is in it keeps its state (its text, its scroll, its focus) for when it comes back.

Signature

pub const fn show<V>(when: bool, view: V) -> Show<V>

Example

use fusuma::{column, show, text};
let signed_in = false;
let view = column((text("Welcome"), show(signed_in, text("Log out"))));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Welcome", "Log out"]);
let page = built.tree().children(built.tree().root().unwrap()).next().unwrap();
let last = built.tree().children(page).last().unwrap();
assert!(built.tree().is_hidden(last));

All components · Source