Menu component: Dense prop doesn't change padding
See original GitHub issueThe documentation explains that a “dense” prop may be applied to the Menu component to reduce its padding. It appears to only change the size of the typography component inside it, but doesn’t change the height of the list item or any of its padding.
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Add a dense prop to a MenuList and the typography component changes from body1 to body2.
Expected Behavior 🤔
Add a dense prop to MenuList and the padding should be reduced, as well as the overall height.
Steps to Reproduce 🕹
I’m only a designer, so I’m inspecting documentation in Chrome and playing with it in code sandbox.
Context 🔦
I want to provide perfect specs to my engineers, and I want to modify components, which requires a perfect understanding of how they’re set up.
Your Environment 🌎
Figma, Chrome.
`npx @mui/envinfo`
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Not able to change padding of material UI Select component
I understand that I need to modify nested components but have been unable to find a working solution. <div className='wifi-chooser-column'> < ...
Read more >[Menu][discussion] Menu height/padding changes in 4.5 ...
In the 4.5 version of Material-UI the height and padding of menu items changed "to better match Google's products" in #17332.
Read more >Density - Material UI - MUI
This tool allows you to apply density via spacing and component props. You can browse around and see how this applies to the...
Read more >margin - CSS: Cascading Style Sheets - MDN Web Docs
This property can be used to set a margin on all four sides of an element. Margins create extra space around an element,...
Read more >List and List Items | Quasar Framework
The QList and QItem are a group of components which can work together to present ... Render an avatar item side (does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, I’m not a developer, but I’d still like to help you repro this.
dense
prop to reduce the padding”.dense
applied has the exact same padding as any menu without dense applied.dense
only changes the size of the typography component.I suggest either updating the documentation’s description to better describe what the prop will do or, better yet, change the behavior of the
dense
prop. I have an actual need of a smaller menu item, and I’m having to make my own.@siriwatknp @danilo-leal I raised a PR for it. Tested it with generated packages locally as well as compared the Netlify builds. Is there something else that needs to be done to ensure no side effects occur?