TreeNodeRow
fun <T> TreeNodeRow(node: TreeNode<T>, depth: Int, expanded: Boolean, toggle: () -> Unit, modifier: Modifier = Modifier, indent: Dp = 16.dp, label: (T) -> String = { it.toString() })(source)
A sensible default row for a single node in a LazyTree. The whole row is clickable to expand or collapse, indentation reflects depth, and a ▾/▸ marker precedes non-leaf nodes.
It is intentionally foundation-only (no Material), so using it does not pull a theming dependency into your app. For full control over a node's appearance, use the LazyTree overload that takes a nodeContent lambda instead.
LazyTree(root) { node, depth, expanded, toggle ->
TreeNodeRow(node, depth, expanded, toggle)
}Content copied to clipboard
Parameters
node
the node to render.
depth
the node's depth in the tree (root = 0), used for indentation.
expanded
whether the node is currently expanded.
toggle
flips this node's expansion state; invoked when the row is clicked.
modifier
the Modifier applied to the row.
indent
the horizontal indentation applied per depth level.
label
maps the node's value to the text shown. Defaults to toString().