Skip to main content

Module tree

Module tree 

Source
Expand description

Tree widget for hierarchical display.

Renders a tree of labeled nodes with configurable guide characters and styles, suitable for file trees or structured views.

§Example

use ftui_widgets::tree::{Tree, TreeNode, TreeGuides};

let tree = Tree::new(TreeNode::new("root")
    .child(TreeNode::new("src")
        .child(TreeNode::new("main.rs"))
        .child(TreeNode::new("lib.rs")))
    .child(TreeNode::new("Cargo.toml")));

assert_eq!(tree.root().label(), "root");
assert_eq!(tree.root().children().len(), 2);

Structs§

Tree
Tree widget for rendering hierarchical data.
TreeNode
A node in the tree hierarchy.
TreePersistState
Persistable state for a Tree widget.

Enums§

TreeGuides
Guide character styles for tree rendering.