Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mui switch colours

const theme = createMuiTheme({
    overrides: {
      MuiSwitch: {
        switchBase: {
          // Controls default (unchecked) color for the thumb
          color: "#ccc",
          "&$checked": {
            // Controls checked color for the thumb
            color: "#f2ff00"
          }
        },
        track: {
          // Controls default (unchecked) color for the track
          opacity: 0.2,
          backgroundColor: "#fff",
          "$checked$checked + &": {
            // Controls checked color for the track
            opacity: 0.7,
            backgroundColor: "#fff"
          }
        }
      }
    }
  });

<Switch
	classes={{
         switchBase:
         switchClasses.switchBase,
         thumb: switchClasses.thumb,
         track: switchClasses.track,
         checked: switchClasses.checked,
        }}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mui #switch #colours
ADD COMMENT
Topic
Name
2+2 =