Created
June 17, 2021 20:22
-
-
Save itashdv/69b47002c2b6a3078418f4aa36c14c18 to your computer and use it in GitHub Desktop.
Material-UI v4 Select (override styles of the dropdown component ul & li)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// https://stackoverflow.com/questions/50353676/how-to-change-the-style-of-the-dropdown-element-of-the-material-ui-select-compon | |
import React from "react"; | |
import { makeStyles } from '@material-ui/core/styles'; | |
import Select from "@material-ui/core/Select"; | |
const useStyles = makeStyles({ | |
select: { | |
"& ul": { | |
backgroundColor: "#cccccc", | |
}, | |
"& li": { | |
fontSize: 12, | |
}, | |
}, | |
}); | |
export default class MyComponent extends React.Component { | |
const classes = useStyles(); | |
render() { | |
return ( | |
<Select MenuProps={{ classes: { paper: classes.select } }} /> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment