2

I previous (v4) I used makeStyle to pass class to PopoverClasses property in element.

How to fill this prop in v5 version where makeStyles is obsolete?

1 Answer 1

2

PopoverClasses prop from Menu is used to inject the class names to the Popover component, whose classes prop has these CSS properties that can be overridden. You can do the same in MUI v5 by getting the popoverClasses from the Popover and apply to the Popover component like this:

import { popoverClasses } from "@mui/material/Popover";
<Menu
  sx={{
    [`&.${popoverClasses.root}`]: {
      backgroundColor: "gray"
    },
    [`& .${popoverClasses.paper}`]: {
      color: "blue"
    }
  }}
  {...}
>

Live Demo

Codesandbox Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.