Skip to content

Tree

marimo.tree

tree(
    items: list[Any] | tuple[Any] | dict[Any, Any],
    label: Optional[str] = None,
) -> Html

Render a nested structure of lists, tuples, or dicts as a tree.

Example
mo.tree(["entry", "another entry", {"key": [0, 1, 2]}], label="A tree.")
PARAMETER DESCRIPTION
items

nested structure of lists, tuples, or dicts

TYPE: list[Any] | tuple[Any] | dict[Any, Any]

label

optional text label for the tree

TYPE: Optional[str] DEFAULT: None

RETURNS DESCRIPTION
Html

Html object

TYPE: Html