Added template for grid columns on Group
#2913
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the current version, the
Group
component is used to organize multiple fields in a single row divided into columns, and it supports two display modes:However, these modes can be limiting when building more customized interfaces, as they don't allow precise control over column widths (e.g., setting one field to take up 10% and another to take up 60% of the row).
To address this, I’ve added a new
widthColumns()
method, enabling CSS Grid support for columns. This method allows for flexible width configurations by passing values for thegrid-template-columns
CSS property. Example usage:The
widthColumns()
method accepts a range of values:30%
120px
2fr
max-content
andauto
Warning
The number of specified values should not be less than the number of elements in the group.
These settings are applied only on desktop displays, while on mobile devices, each field will continue to display on a new row for better responsiveness.
This enhancement makes the
Group
component more versatile, allowing for customized column width distributions to create more tailored interfaces.Conflict or Inconsistency
We already have a similar mechanism in the
Split
layout, where it’s possible to define aratio
:I’m concerned that this new implementation may introduce inconsistency.