Skip to contentSkip to content

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.

Props

NameTypeDescription
childrennode

The content of the loading row. When not provided, the default skeleton placeholders are rendered.

classesobject

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 itemLoader slot. The component does not render it.

The component cannot hold a ref.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.MuiTreeItemLoader-checkboxcheckboxStyles applied to the checkbox placeholder element of the default content.
.MuiTreeItemLoader-iconContainericonContainerStyles applied to the icon gutter element of the default content.
.MuiTreeItemLoader-labellabelStyles applied to the label placeholder element of the default content.
.MuiTreeItemLoader-rootrootStyles applied to the root element.

You can override the style of the component using one of these customization options:

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.