Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To change the font size of labels in a tree view using Material UI, you can use the following steps:

  1. In the styles section of your component, define a class for the label with the desired font size. For example:
const useStyles = makeStyles({
  label: {
    fontSize: '1.2rem',
  },
});
  1. Pass the class to the TreeItem component's classes prop. For example:
<TreeItem nodeId="1" label="Item 1" classes={{ label: classes.label }}>

This will apply the label class to the label of the TreeItem, which will set its font size to 1.2rem. You can adjust the font size value as needed to achieve the desired result.