If you are working with material-ui V4 and utilizing hooks, here is how you can customize ListSubheader styles:
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';
import ListSubheader from '@material-ui/core/ListSubheader';
const useStyles = makeStyles(theme => ({
listSubHeaderRoot: {
backgroundColor: '#E5E5E5',
color: '#252525'
/* To change the font, use the fontFamily rule */
}
}));
export default function PinnedSubheaderList() {
const classes = useStyles();
return (
<List subheader={<li />}>
{[0, 1].map(sectionId => (
<li key={`section-${sectionId}`}>
<ul className={classes.ul}>
<ListSubheader classes={{root:classes.listSubHeaderRoot}}>{`I'm sticky ${sectionId}`}</ListSubheader>
{[0, 1].map(item => (
<ListItem key={`item-${sectionId}-${item}`}>
<ListItemText primary={`Item ${item}`} />
</ListItem>
))}
</ul>
</li>
))}
</List>
);
}
https://codesandbox.io/s/material-demo-krzsh?fontsize=14&hidenavigation=1&theme=dark