-
Notifications
You must be signed in to change notification settings - Fork 4.1k
RFC: Standardize width props #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue should also consider that the plural name props (fields, cards, etc) are used to pass an array of objects in to generate children. If the plural prop is reserved for widths, there will be a conflict. Whereas, allowing <Form fields={[...]} widths={3} /> |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
FWIW I also just 👍 this. It's currently on the v1 milestone. Might make sense to move this to the v2 milestone instead if this is something that will take a lot to shift to. But I'd prefer the optimization to happen in both from a support standpoint as we move past v1. |
There has been no activity in this thread for 90 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 90 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
Unstale, please :cat |
There has been no activity in this thread for 180 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 180 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
Unstale 🎬 |
There has been no activity in this thread for 180 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 180 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
I am new to open-source contributions and I want to contribute. Can you explain what I have to do? I am a little bit confused.
|
I am new to open-source contributions and I want to contribute. Can I handle this issue? |
Issue
Many components can specify a width in number of grid columns, sometimes also supporting
equal width
. We've standardized the values we accept (number, string, 'equal').However, the prop name used to control the width or width of child components is inconsistent.
There are three types of components to consider that implement some type of width prop.
Group Components
The popular vote here was to use
widths
.Card.Group
itemsPerRow
was used as an experiment to test it's intuitiveness overwidths
.Parent Components
Form
supportsequal width
only.Grid.Column
parents usecolumns
as it is most intuitive.Individual Components
Individually sized components seem to work well using
width
. This is clear and consistent.Brainstorm & Analysis
I propose the individual component
width
prop remain as is. This RFC considers only parent and group width props.Here are some opinionated but flexible API guidelines:
Plural Names
In use on Parents, not Groups. Here's what it would look like for all components:
<Button.Group buttons='2' /> == two ui buttons
<Grid columns='2' /> == two column grid
<Column width='2' /> == two wide column
<Statistic.Group statistics='2' />
width(s)
Previously voted for use on Groups. Here's what it would look like for all components:
Form>Fields
,Grid>Column
).itemsPerRow
Conclusion & Proposal
With equal requirement weighting plural names are the best pattern overall. This then is also my proposal. Feedback welcome, otherwise any PR closing this issue should implement plural names.
width(s)
(9)itemsPerRow
(7)itemsPerRow
width(s)
itemsPerRow
widths
The text was updated successfully, but these errors were encountered: