Skip to content

Instantly share code, notes, and snippets.

@itashdv
Created June 17, 2021 20:22
Show Gist options
  • Save itashdv/69b47002c2b6a3078418f4aa36c14c18 to your computer and use it in GitHub Desktop.
Save itashdv/69b47002c2b6a3078418f4aa36c14c18 to your computer and use it in GitHub Desktop.
Material-UI v4 Select (override styles of the dropdown component ul & li)
'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