score:0
Try that in your global css or scss file:
button.MuiToggleButton-root.Mui-selected {
background-color: #1f792f !important;
border-color: #000 !important;
}
score:0
Create new class and dont forget to use !important to override the backgroundColor of "Mui-selected" class
classes= useStyle({
newClass { backgroundColor:'red!important'},
})
<ToggleButton
classes={{
selected:clasess.newClass,
.
.
.
}}
value=''
/>
score:2
const useStyles = makeStyles(theme => ({
ToggleButton : {
'&.MuiToggleButton-root.Mui-selected': {
backgroundColor: theme.palette.common.white,
}
}
}));
Source: stackoverflow.com
Related Query
- Material UI Toggle Button - can't change background color when selected
- how to change background color when I click the button using react hooks
- Is there a way to change the background color of a parent element when a radio button is clicked without jQuery?
- MUI's Chip Component change background color when selected
- How can I change the border color when I hover a button with Material UI
- How to change button background color when I click the button in React using Hooks
- How to change background color of react native button
- 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
- How to change background color of a selected ItemList Material-Ui
- How to remove selected value when click button of Autocomplete Material UI?
- How do I change the background color of a selected react-bootstrap ToggleButton?
- Unable to change border color when focused and not focused of Material UI Input
- How to change the selected table row background color with React
- Change background color of Material Ui datepicker
- How to change navbar background color in react when I scroll
- how to change the line color in the NavBar toggle button in react-bootstrap?
- Material UI Select focus and selected background color
- How to change the background and text color within button using button onClick in React JS
- React: Button does not change its color after Material UI theme changed
- Use click handler to change color of button when there are multiple buttons using the same function
- Material Table rowStyle background color change based on cell value in
- How to change background color of button using react
- Material UI Autocomplete change selected value of one autocomplete when value is changed in another autocomplete
- Material UI styled() utility - How to recursively change highlighted text background color
- in a map function, i want to set a state which let me change the background color when i click on a div
- How do i change the color of a button when clicked in react?
- TextField Background change background color when selecting a text from sugestions
- How to change the background or text color of the countdown timer to green when there is only 30 minutes remaining to finish the countdown?
- Change a different Background Color of Chip(material-UI) in a Comments Module when the user is Admin
More Query from same tag
- How to import a sound file into react typescript component?
- Exclude blacklisted exact routes on React Router DOM
- can't loop through an object in React?
- Next.js and Webpack inline Javascript or CSS ressources
- React-Select: How to clear a selection value when another selection value change
- Can't figure out what is missing in this code
- PropTypes for react-redux/react-router connect & withRouter functions' ownProps parameter?
- Cannot connect component to redux store
- React - get element.getBoundingClientRect() after window resize
- Can't send patch request to React Native
- JSX Spread Attributes on client side non-ES6 browsers
- Material UI issue with InputAdornments
- lodash isEmpty and has method vs simple check
- There is a way to call hooks conditionally in React?
- Pass props to other component ReactJS
- Why is the data undefined in react component?
- How to update this deprecated React.PropTypes code
- React: className to unique element in list
- How to add items which contains in loop and adding into the array?
- How can i get the Video duration of a selected video from input in ReactJs?
- Building a Higher Order Component Error Boundary
- How does Express and React Routes work on initial GET request from browser?
- How can I update the state of my container component from one of its children in React?
- Webpack + Linaria - Support for the experimental syntax 'jsx' isn't currently enabled
- Want to route one component to another component
- Setting Routes for Deployment
- handleSubmit triggered with invalid field
- How to pass the path of an image in React component?
- How do I configure parcel to exit build with an error if eslint does not validate
- How to use environment variables in Github Page?