score:3
Accepted answer
const styles = theme => ({
root: {
width: '100%',
maxWidth: 360
},
icon: {
color: 'red',
}
});
export default function List(props) {
const { classes } = props;
return (
<div className={classes.root}>
<List component="nav">
<ListItem button>
<ListItemIcon className={classes.icon}>
<InboxIcon />
</ListItemIcon>
<ListItemText primary="Inbox" />
</ListItem>
</List>
</div>
);
}
Here is an article about it (className
use-related).
score:0
According to the documentation you can override the style of the component with a rule name of the classes object prop.
Here is the answer with an example: https://github.com/mui-org/material-ui/issues/12023
score:0
const useStyles = makeStyles({
listItem: {
'&:hover': {
backgroundColor: theme.palette.primary.light,
color: theme.palette.primary.main,
'& .MuiListItemIcon-root': {
color: theme.palette.primary.main,
},
},
},
})
Source: stackoverflow.com
Related Query
- Change Color in react material UI ListItemIcon
- How do you change the Stepper color on React Material UI?
- Divider color change React Material Ui
- How to change outline color of Material UI React input component?
- Change the MobileStepper color on React Material UI
- How to change the color of the placeholder in material UI React js
- I want to change the color of button in react using material ui
- React Material UI - Change Stepper text color
- react js material ui treeView change text color of tree item's label
- Change color using useState on React using Material UI
- Change color of active button among multiple buttons in React using material ui
- How to change the progress bar background color dynamically in react material ui?
- React testing library on change for Material UI Select component
- change button color react native
- How to change background color of react native button
- Change color of Select component's border and arrow icon Material UI
- React Material UI: How to give a button a custom color when disabled?
- How to change the text color of the selected row in material ui table
- Change Ripple Color on click of Material UI <Button />
- How can I change the color of a Link in React with Material-UI?
- Change default Text Color Material UI
- How to change the primary color of the react built-in bootstrap?
- How can I create a color variant from a base color in React Material UI?
- How to change color of fontawesome icons in modular css React
- color change for the loading bar component of material ui
- Change color of selected element - React
- Change color of Material UI Indeterminate Checkbox
- How to change text, icon and underline color of Select in Material UI
- Change the background color of a screen with react native
- Material UI: Change theme color by SASS variables
More Query from same tag
- npm karma phantomJS undefined is not a constructor
- React and Ag-Grid: populating selectcelleditor through fetch gives 'state' of undefined
- Alert gives TypeError: this is undefined
- Modal isn't showing properly
- Problem in React typing text in a field text
- 'Router' cannot be used as a JSX component
- mobX: TypeError: Cannot read properties of undefined
- "Objects are not valid as a React child" when adding user data to Firestore
- React router v4 Route doesn't display the component
- Why did the two seperate chart components squeeze into the same box?
- Pass props to another component onclick of a button
- Material UI Autocomplete add item with multiple select
- How to get the npm script arguments in reactjs
- In my react app, url updates but the page does not redirect until browser refresh
- Creating nested objects with es6
- change in style of material ui InputLabel component not working. code below
- Update state from other Component to Main Component
- Select rows issue in pagination react table
- I can't understand why and how are we passing something to this function. Selector question
- allow typescript compiler to call setState on only one react state property
- Javascript : print property "name" and "value" in each object in an array using map
- React - Conditional JSX Render
- Error declaring constant in react ts component
- Generate coverage with Mocha and Istanbul
- ReduxForm - getting select value from Semantic-UI select input
- How to change state in one page from a link click from another page?
- Stagger Siblings in Framer Motion to perform Share Buttons Animation?
- How to add input text event handler in react
- How can i use city name instead of lat and log in OpenWeather API?
- Is there a built-in interface for flex properties such as align-items and justify-content?