Use css grid to layout form
See original GitHub issueIs your feature request related to a problem? Please describe. Current react-layout use Section and Box to align component, which is flexible. But I feel it is not Intuitive,specially Box nested Box in source code.
Describe the solution you’d like Css grid is modern layout, which is intuitive and powerful. Specially grid-area is suit to layout form.
Describe alternatives you’ve considered For example, we can define form layout like this:
// CSS
.container {
grid-template-areas:
"name name age age" // <<---------- define component occupy which cell, can span rows or cols
"phone phone " //
}
.name {
grid-area: name;
}
.age {
grid-area: age;
}
.phone {
grid-area: phone;
}
// JS
<Field id="name" className="name" />
<Field id="age" className="age" />
<Field id="phone" className="phone" />
...
Changing grid-template-areas will change layout. Grid-template-areas string is just like EXCEL, can span cols and rows, is very flexible.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
How to Build Web Form Layouts With CSS Grid
Our goal when using “Grid” is to define two columns, and then place each element in its required column. ... Based on the...
Read more >Realizing common layouts using grids - CSS - MDN Web Docs
With CSS Grid Layout, we can place things into rows, with no danger of them rising up into the row above if it...
Read more >CSS Grid Form Examples - Quackit Tutorials
Examples of form layouts using CSS grid layout. ... These examples use various grid settings to display the cards in a different way....
Read more >The Benefits of Using CSS Grid for Web Form Layout - SitePoint
Grid is two-dimensional and respects both rows and columns. If an element is too big for its cell, the row and/or column will...
Read more >How to create a simple form with CSS Grid - freeCodeCamp
From the picture above, we know the form contains two elements: ... To build the form with CSS Grid, you need to set...
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
pr - https://github.com/yahoo/jafar/pull/65 demo - https://yahoo.github.io/jafar/demo-react-layout.html#/item/sections-grid/html
available on v1.0.7
done 😃 i was slow here lol