tree_node: Tree nodes

View source: R/widget-treeview.R

tree_nodeR Documentation

Tree nodes

Description

Tree nodes

Usage

tree_node(label, ..., data = NULL, expanded = FALSE, id = NULL, loader = NULL)

Arguments

label

Text shown for the node.

...

Child nodes, or strings (leaf nodes).

data

Any R value attached to the node (e.g. a file path).

expanded

Start expanded?

id

Optional identifier (see node$find(id)).

loader

Optional ⁠function(node)⁠ returning child nodes (or labels), called the first time the node is expanded. Use it for large or expensive trees such as file systems.

Value

A TreeNode.

Examples

root <- tree_node("Project", tree_node("R", "app.R", "widget.R"), "README.md", expanded = TRUE)
root

termr documentation built on Oct. 21, 2026, 5:13 p.m.