One row of a tree: indented by depth, a triangle that opens and closes it when it has children (expanded is Some), and the label as a choice. Build a tree by putting a row and then, under show(expanded, column(..)), its children's rows one level deeper.
One row of a tree, depth levels in. expanded is None for a leaf, Some(open) for a branch; on_toggle opens and closes it, on_select chooses it.
Signature
pub fn tree_item<'a, M: Clone + 'a>( label: &'a str, depth: u32, expanded: Option<bool>, selected: bool, on_toggle: M, on_select: M, ) -> impl View<M> + 'aExample
use fusuma::{column, tree_item};
let view = column((
tree_item("src", 0, Some(true), false, (), ()),
tree_item("main.rs", 1, None, true, (), ()),
));
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.texts().contains(&"main.rs"));