question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use css grid to layout form

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
galhavivicommented, Jul 8, 2020

done 😃 i was slow here lol

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found