Skip to content

Commit 7d60159

Browse files
authored
docs(material/tree): add instructing to use flat tree for best performance (#25211)
Add instructions in the tree documentation to use flat trees for best performance. Resolves #11602
1 parent a5595cd commit 7d60159

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/material/tree/tree.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ data source input and template, except that its element and attribute selectors
66
with `mat-` instead of `cdk-`.
77

88
There are two types of trees: Flat tree and nested tree. The DOM structures are different for these
9-
two types of trees.
9+
two types of trees. Flat trees generally offer better performance, while nested trees provide
10+
flexibility.
1011

1112
#### Flat tree
1213
In a flat tree, the hierarchy is flattened; nodes are not rendered inside of each other,
@@ -26,8 +27,9 @@ used to style the node such that it is indented to the appropriate level.
2627

2728
<!-- example(tree-flat-overview) -->
2829

29-
Flat trees are generally easier to style and inspect. They are also more friendly to
30-
scrolling variations, such as infinite or virtual scrolling
30+
Flat trees are generally easier to style and inspect. They are also more friendly to scrolling
31+
variations, such as infinite or virtual scrolling. Flat trees
32+
generally offer better performance.
3133

3234
<!--TODO(tinayuangao): Add a flat tree example here -->
3335

0 commit comments

Comments
 (0)