[Grid] Allow different values for x and y spacing
See original GitHub issue- This is a v1.x issue (v0.x is no longer maintained).
- I have searched the issues of this repository and believe that this is not a duplicate.
Feature request
When using Grid
’s spacing
attribute it affects equally vertical and horizontal spacing. It would be nice to be able to set them differently.
My use-case is that I use Grids to layout form elements. The TextFields already have the expected vertical spacing so I would like Grid to just provide the horizontal spacing. I put up a demo showing the spacing in the form use-case: https://codesandbox.io/s/jnjon2oq5
My suggestion is to add another attribute like offSpacing
(?) that when specified defines the gap size in off-direction (when direction is row this defines the y-spacing and vice versa). When this attribute is not given spacings are equal.
Your Environment
Tech | Version |
---|---|
Material-UI | v1.0.0 |
React | 16.4.0 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:33
- Comments:17 (12 by maintainers)
Top Results From Across the Web
[Grid] Allow different values for x and y spacing #11764 - GitHub
My suggestion is to add another attribute like offSpacing (?) that when specified defines the gap size in off-direction (when direction is row ......
Read more >Grids, logical values, and writing modes - CSS - MDN Web Docs
For this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and...
Read more >How to have different horizontal and vertical spacing in MUI ...
Material UI Grid layout is based on the flexbox model. So, setting container attribute on Grid, sets "display flex" on it. Now items...
Read more >Spacing, grids, and layouts - DesignSystems.com
Spatial systems, grids, and layouts provide rules that give your designs a consistent rhythm, constrain decision making, and help teams stay aligned.
Read more >To Display a Grid and Set the Grid Spacing | AutoCAD 2021
In the Grid X Spacing box, enter the horizontal grid spacing in units. Note: The check box, Equal X and Y Spacing, applies...
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 Free
Top 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
I’ve also just come across this problem with developing some prototypes for a very very… very… long form (luckily for expert users) who would prefer the forms vertical spacing to be absolutely minimised, but having multiple inputs on a row still space apart visually… I could potentialls space them with another item - but would add to the coding overhead.
Ability to set spacing={x} or spacingRow={x} and spacingColumn={y} on a container would be great.
Actually, we could already implement this today. It should be easy.