I want to add a background color to the MUI Pagination prev and next icons but the MUI exposes only the Pagination element that doesn't seem to take a style object and apply it to the icons but to the Pagination as a whole.
Here's what I tried first:
const useStyles = makeStyles(() => createStyles({
page: {
padding: '0',
},
icon: {
borderRadius: '16px',
padding: '0 6px',
backgroundColor: '#b74d3e',
width: '100%',
height: '100%',
color: '#fff',
},
}));
const classes = useStyles();
Applying it to Pagination like
<div className={`${classes.page} ${classes.icon}`}>
<Pagination count={16} />
</div>
resulted in all the styles rules applied to the whole Pagination element.
The second go was attempt to use the PaginationItem element which seem to require a custom element (component) to display it on the screen. I'm not sure how to provide one and if it's needed to change the icon background color only.
<Pagination
count={16}
renderItem={() => (
<PaginationItem
component={}
classes={{
page: classes.page,
icon: classes.icon,
}}
/>
)}
/>
An empty component returns an error and React's Link didn't pass for a valid one.
How do I change the prev and next arrow icon background color?