Rich Tree View - Customization
Learn how to customize the Rich Tree View component.
Basics
Custom icons
Use the collapseIcon
slot, the expandIcon
slot and the defaultEndIcon
prop to customize the Tree View icons.
The demo below shows how to add icons using both an existing icon library, such as Material Icons, and creating an icon from scratch using Material UI's SVG Icon component.
- @mui/x-data-grid
- @mui/x-data-grid-pro
- Date and Time Pickers
- Charts
- Tree View
Custom toggle animations
Use the groupTransition
slot on the <TreeItem />
to pass a component that handles your animation.
The demo below is animated using Material UI's Collapse component together with the react-spring library.
- @mui/x-data-grid
- @mui/x-data-grid-pro
- Date and Time Pickers
- Charts
- Tree View
Custom styling
Use treeItemClasses
to target internal elements of the Tree Item component and change their styles.
- @mui/x-data-grid
- @mui/x-data-grid-pro
- Date and Time Pickers
- Charts
- Tree View
Custom Tree Item
You can use the Tree Item's customization API to build new layouts and manage behaviors. Learn more about the anatomy of the Tree Item components and the customization utilities provided in the Tree Item customization doc.
Headless API
Use the useTreeItem2
hook to create your own component.
The demo below shows how to add an avatar and custom typography elements.
- AAmelia Hart
- BBailey Monroe
- FFreddie Reed
- GGeorgia Johnson
Common examples
File explorer
The demo below shows many of the previous customization examples brought together to make the Tree View component look completely different than its default design.
Invoice
Meeting notes
Tasks list
Equipment
Video conference
Personal
Group photo
Bookmarked
History
Trash
API
See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.