-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popover arrow addition #18928
Comments
@wbobeirne We have no plan to supper such. If you find a good solution, it would be awesome to share it back :) |
Hi , |
@aneesha2890 Replying for anyone else finding this thread. I was hoping to do this too. I'm sure it can be done with other MUI styling props, but I didn't find anything quick. |
@tedpennings You can use the source of the tooltip as inspiration: |
Not generic but if you override the paper class you can add an arrow (in this case a down arrow): const styles = (theme: Theme) =>
createStyles({
paper: {
overflowX: "unset",
overflowY: "unset",
"&::before": {
content: '""',
position: "absolute",
marginRight: "-0.71em",
bottom: 0,
right: 0,
width: 10,
height: 10,
backgroundColor: theme.palette.background.paper,
boxShadow: theme.shadows[1],
transform: "translate(-50%, 50%) rotate(135deg)",
clipPath: "polygon(-5px -5px, calc(100% + 5px) -5px, calc(100% + 5px) calc(100% + 5px))",
},
},
});
...
<Popover classes={{ paper: classes.paper }} >
{children}
</Popover> |
Here is another working demo: stackoverflow |
Summary 💡
I'm trying to add customize my Menu components by adding an arrow to them, but unfortunately it looks like that may not be possible. I had hoped the issue had been covered in #10772, but despite the title of that issue, it was only solved for
Popper
s, notPopover
s. I would just use aPopper
, butSelect
components useMenu
s which usePopover
s, and there doesn't seem to be an escape hatch to override that. I can't use pseudo elements, since the absolutely positioned element isoverflow: hidden
, and a pseudo element arrow can't sit outside of it.Ideally there could be a prop similar to Poppers
modifiers={{ arrow: { enabled: true }}}
that adds an element adjacent to thePaper
inPopover
somewhere around here: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Popover/Popover.js#L398-L406Examples 🌈
https://material-ui.netlify.com/components/popper/#scroll-playground
Motivation 🔦
Hopefully this further makes Material UI more themeable.
The text was updated successfully, but these errors were encountered: