-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Document the TreeItem2
component and the useTreeItem2
hook
#14551
Conversation
|
||
You can select an item of the Tree View by clicking its content slot. The demo below demonstrates how to handle selection when the user clicks on an icon. | ||
|
||
{{"demo": "HandleSelectionDemo.js"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am struggling to find a decent use-case/ idea for a demo for handleSelection
and handleCheckboxSelection
-> so any suggestions are welcome here.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/rich-tree-view/customization/customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/simple-tree-view/customization/customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
|
||
By default, a tree item is expanded when clicking the content. You can change the expansion trigger using the `expansionTrigger` prop to the `iconContainer`. Read more about the expansion API on the dedicated [documentation page](/x/react-tree-view/rich-tree-view/expansion/#limit-expansion-to-icon-container). | ||
|
||
To achieve a deeper customization of the expansion of an item use the `handleExpansion` interaction method. The demo below demonstrates how to introduce a new element that expands or collapses the item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To achieve a deeper customization of the expansion of an item use the `handleExpansion` interaction method. The demo below demonstrates how to introduce a new element that expands or collapses the item. | |
Use the `handleExpansion` interaction method for deeper customization of Item expansion. | |
The demo below shows how to introduce a new element that expands and collapses the Item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for deeper customization of Item expansion.
sounds a bit weird to me 🤔 not sure why. Maybe for deeper customization of the Item's expansion behavior.
?
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
docs/data/tree-view/tree-item-customization/tree-item-customization.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Sycamore <71297412+samuelsycamore@users.noreply.github.com> Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @samuelsycamore 🎉 😄
|
||
By default, a tree item is expanded when clicking the content. You can change the expansion trigger using the `expansionTrigger` prop to the `iconContainer`. Read more about the expansion API on the dedicated [documentation page](/x/react-tree-view/rich-tree-view/expansion/#limit-expansion-to-icon-container). | ||
|
||
To achieve a deeper customization of the expansion of an item use the `handleExpansion` interaction method. The demo below demonstrates how to introduce a new element that expands or collapses the item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for deeper customization of Item expansion.
sounds a bit weird to me 🤔 not sure why. Maybe for deeper customization of the Item's expansion behavior.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the terrific work 🙏
useTreeItem2
and TreeItem2
TreeItem2
component and the useTreeItem2
hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to have more customzation docs 👍
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small regression, it got fixed in HEAD already.
: '/static/x/tree-view-illustrations/tree-item-dark.png'; | ||
return ( | ||
<Card elevation={0} variant="outlined" sx={{ padding: 4 }}> | ||
<CardMedia |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image width growth too much. src is 1440px so can only support up to 720px without looking blurry (desktop width is more like 740px).
const src = | ||
palette.mode === 'light' | ||
? '/static/x/tree-view-illustrations/tree-item-light.png' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern will blink for dark mode users (once docs-infra starts and finishes the migration to CSS variables).
I think the right pattern here is to follow the other instances:
mui-x/docs/data/introduction/support/support.md
Lines 35 to 40 in 05e83ee
<span class="only-light-mode"> | |
<img src="/static/docs-infra/forking-an-example.png" alt="Forking an example" loading="lazy" width="1628" height="700" style="display: block; max-width: 774px;"> | |
</span> | |
<span class="only-dark-mode"> | |
<img src="/static/docs-infra/forking-an-example-dark.png" alt="Forking an example" loading="lazy" width="1628" height="700" style="display: block; max-width: 774px;"> | |
</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thought on this one. It feels like we should link the source to the Figma file we used (a code comment I guess) so anyone can easily come here and change the image when we reorganize the component structure.
Closes #13161