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.")
Args.

  • items: nested structure of lists, tuples, or dicts
  • label: optional text label for the tree

Returns.

Html object