Skip to content

[docs] Add recipe for getting the tree view's root DOM element via ref#22941

Open
michelengelen wants to merge 1 commit into
mui:masterfrom
michelengelen:recipe/treeview/20743
Open

[docs] Add recipe for getting the tree view's root DOM element via ref#22941
michelengelen wants to merge 1 commit into
mui:masterfrom
michelengelen:recipe/treeview/20743

Conversation

@michelengelen

Copy link
Copy Markdown
Member

Resolves a request to expose rootElementRef on apiRef (mirroring the Data Grid). No new API is needed: RichTreeView and SimpleTreeView already forward their ref to the root <ul> element. Adds a demo and a new "Get the root DOM element" section to the items docs.

Fixes #20743

@michelengelen michelengelen self-assigned this Jun 25, 2026
@michelengelen michelengelen added docs Improvements or additions to the documentation. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. recipe labels Jun 25, 2026
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. recipe scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tree view] Add a rootElementRef property to the apiRef like on the Data Grid

1 participant