Skip to content

Tree

A hierarchical list of expandable items, with the selection bound to selected.

ui.tree
ui.tree(&mut self.folder).children(|tree| {
tree.item(1, "src").icon(IconName::Folder).default_open(true).children(|tree| {
tree.item(2, "main.rs").icon(IconName::File).show();
tree.item(3, "ui").icon(IconName::Folder).children(|tree| {
tree.item(4, "button.rs").icon(IconName::File).show();
});
});
tree.item(5, "Cargo.toml").icon(IconName::File).show();
});

API reference

SettingDescription
.children(f: impl FnOnce(&mut TreeUi<'_, 'a, T>))Places the tree; f declares its top-level items.