TreeItemLoader API
API reference docs for the React TreeItemLoader component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { TreeItemLoader } from '@mui/x-tree-view/TreeItemLoader';
// or
import { TreeItemLoader } from '@mui/x-tree-view';
// or
import { TreeItemLoader } from '@mui/x-tree-view-pro';Learn about the difference by reading this guide on minimizing bundle size.
Semantic wrapper for one loading row of the Rich Tree View.
It renders a li element with the role, aria attributes, indentation and
height of a tree item, so custom loading UIs stay accessible and aligned.
Without children, it renders the default skeleton placeholders.
| Name | Type | Description |
|---|---|---|
| children | node | The content of the loading row. When not provided, the default skeleton placeholders are rendered. |
| classes | object | Override or extend the styles applied to the component. See CSS classes API below for more details. |
| ownerState | { index: number, isCheckboxSelectionEnabled: bool, itemDepth: number, itemsCount: number } | State of the loading row, forwarded by the |
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
| Class name | Rule name | Description |
|---|---|---|
| .MuiTreeItemLoader-checkbox | checkbox | Styles applied to the checkbox placeholder element of the default content. |
| .MuiTreeItemLoader-iconContainer | iconContainer | Styles applied to the icon gutter element of the default content. |
| .MuiTreeItemLoader-label | label | Styles applied to the label placeholder element of the default content. |
| .MuiTreeItemLoader-root | root | Styles applied to the root element. |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverridesproperty in a custom theme.
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.