You can easily do it via providing a classname to your MiuTreeItem-Component:
<TreeView>
<TreeItem nodeId="1" label="Applications">
<TreeItem classes={{ root: 'own-style-1' }} nodeId="2" label="Calendar" />
<TreeItem classes={{ root: 'own-style-2' }} nodeId="3" label="Chrome" />
<TreeItem classes={{ root: 'own-style-3' }} nodeId="4" label="Webstorm" />
</TreeItem>
</TreeView>
This way, each of your TreeItem nodes can have a different styling.
In your css you can specify the class as usual:
.own-style-1 {
background: #ff0099 !important;
color: #ffffff;
}
.own-style-2 {
background: #003399 !important;
color: #ffffff;
}
.own-style-3 {
background: #ee5532 !important;
color: #ffffff;
}
In order to style only the root element without its child elements:
<TreeItem classes={{ content: 'own-style-1' }} nodeId="1" label="Applications">
<TreeItem nodeId="2" label="Calendar" />
<TreeItem nodeId="3" label="Chrome" />
<TreeItem nodeId="4" label="Webstorm" />
</TreeItem>
See it working here:
https://codesandbox.io/embed/heuristic-fire-iwx8l