Layout: Grouping/Segmenting controls
See original GitHub issue
I think we need some components/conventions to make it simple to create cohesive clusters and groupings of controls. In the screenshot above, things are arbitrarily spaced using <Spacer />
. It works as it follows the grid system, but I feel like it should be even more seamless than that.
Maybe something like this?
<FormGroups title="Dimensions">
<FormGroup label="Width">
<TextInput />
</FormGroup>
<FormGroup label="Height">
<TextInput />
</FormGroup>
</FormGroups>
Similar to how iOS handles clusters (groups) of controls via Tables

https://developer.apple.com/design/human-interface-guidelines/ios/views/tables/
Not only should it handle the typical use-case of Label [ TextInput ]
, but it should also accommodate custom UI, like a potential color setting (below):

Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Arranging the layout of controls - IBM
The layout of components is relative to the other components in a user interface. Use container controls, like sections and tables, to group...
Read more >The Definitive Guide to Keyword Organization - WordStream
such as clustering, grouping, segmenting and even categorizing. However you describe it, ... meaningful keyword organization plan for your SEM campaigns.
Read more >10 Tips to Develop Your Holiday Content Marketing Strategy
Let your audience get a glimpse of your company holiday party, and don't be afraid to add festive design touches to your websites, ......
Read more >Arranging Controls Layout - DocuPhase Platform
Arranging Controls Layout. You can organize and rearrange the controls in your form by dragging controls and dropping them in the appropriate place....
Read more >Designing Practice: A Review of - jstor
tions related to the design of practice ac- tivities. ... predicting and controlling behavior ... grouping, segmenting, sequencing, or acronyms.
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
As a prototype, I feel like this definitely suggests the “dim adjacent” feels sufficient. Also, that’s a lot of colors in the test, which suggests a scrolling popover — a scrolling popover inside a sidebar that may also be scrolling would be a really bad experience, which I also feel suggests that opening these inline feels right.
I think I’ve figured out the Component structure API!
The challenge is that this (generic) ListGroup must accommodate varying control types (sliders, switches, text inputs, etc…). There are some common patterns though for ListGroup usage, such as:
With how Gutenberg is evolving, controls will most likely need to be enabled or disabled based on configs. Therefore, the layout components must account for this - whether it’s side margins, bottom margin zero’ing, or grid gaps.
Thankfully, we have some of this stuff figured out with
Grid
,HStack
, andVStack
.Demo
Below is a demo for how a mixture of controls can be grouped, sectioned, and enabled/disabled at will. The margin/spacing between controls maintain the “rules” determined by G2’s grid/spacing systems.
Code
Here’s the exciting me (for me at least, haha), check out the code:
A cluster using a
Grid
may look like this:Here they are combined:
Notice the
ListGroups
wrapperHeader + Action
There may be a case where the Header title may be accompanied by an action (right side).
The code to do this is also quite simple!
Context Is King
Certain components that render under
ListGroup
needed to adjust their behaviour (e.g. spacing). This was all achieved using G2’s Context System, not arbitrary CSS targeting (although the principles are similar).This is an important distinction.
Components can gain “awareness” based on where they’re placed, and adapt their functionality accordingly.
This is very different compared to CSS where…
HTML elements can gain style rules based on where they’re placed, and adapt their aesthetics accordingly.
A
ListGroupHeader
knows it’s inside of aListGroup
, and is placed accordingly. If aGrid
is rendered as a child withinListGroup
, it’s gap spacing is tweaked, (without affecting potential childGrid
components).