Material UI Drawer set background color

In Material UI v5, you can use the sx prop to style Material UI components:

<Drawer
  PaperProps={{
    sx: {
      backgroundColor: "pink",
      color: "red",
    }
  }}

Or use styleOverrides to define the custom styles in createTheme:

const theme = createTheme({
  components: {
    MuiDrawer: {
      styleOverrides: {
        paper: {
          backgroundColor: "pink",
          color: "red",
        }
      }
    }
  }
});

Codesandbox Demo

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)