-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Grid component react #4894
Grid component react #4894
Conversation
Deploy preview for the-carbon-components ready! Built with commit 34c2cbf https://deploy-preview-4894--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 34c2cbf |
Deploy preview for carbon-components-react failed. Built with commit 34c2cbf https://app.netlify.com/sites/carbon-components-react/deploys/5e31ce0762b86e0008b279b9 |
Hi @zachhardesty7! 👋 Thanks so much for taking the time to put this together! I will definitely take a look at this tomorrow!! 🥳 |
Taking a quick look, any chance we could remove support for Definitely understand the prop changes in part, I think Are there any other examples that you'd recommend looking at for an ideal grid API here? Seems like we would want:
|
I only implemented those since the Grid component/element package demo and the outputted CSS support them. Does the doc here (the red X) indicate that the classes output by the SCSS shouldn't be used? It wasn't quite clear to me whether they're internal or not. It's an easy change though! I'm not a huge fan of the offset stuff as separate props either, feels a bit messy. I suppose it could be done via a single This implementation handles auto via the string In personal and freelance projects, it feels like I've rarely used props as a part of the Grid, but maybe it would benefit us to have some numbers behind how often props are used? I haven't done anything with parsing Github code usage, but I suspect the most popular APIs should mirror usage. Let me look into it a bit further and respond with some more detailed resources of what I find! |
@joshblack
Antd has a cool way of doing it, but since they base it on the Bootstrap style anyway, it makes the most sense to get rid of the offset prop entirely and just support Disqualified examples / research data conclusions(note: repos without a significant commit within about the last year are excluded) MiscReact MD - too many props Seem much more like Carbon DataTableNo flexbox-style responsive grid component (e.g. uses CSS Grid style or no Grid included)Blueprint, React Toolbox, Belle, Khan Academy, Hedron, Atlas Kit, MS Office Fabric, Grommet Grid component is not responsive / does not support media queries |
@zachhardesty7 would you mind if I push some updates to your PR here or would you prefer if I opened up a PR to merge into this branch? I just wanted to double-check with you to see how you felt about the changes, didn't want it to feel like we were disregarding any of your work here as it's all awesome! Thanks again for taking the time to contribute! |
@joshblack Whatever makes the most sense / seems the most reasonable to you is fine by me! |
@zachhardesty7 just pushed some updates, would love to know what you think! Tried to do the following:
|
FYI @alisonjoseph too for Grid components 👀 Relevant storybook story for usage: https://github.com/carbon-design-system/carbon/pull/4894/files#diff-d9adc48479ce140b1bc043298685114c |
Updated @zachhardesty7! Thanks again! |
…grid-component-react
…n into grid-component-react
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Thank you @zachhardesty7 for taking the time to do this! 🎉
This is my first major PR (for Carbon & in general) so any feedback is appreciated! My code focuses heavily on readability and simplicity while mimicking design patterns from other React components, Carbon and otherwise.
Add layout helpers for managing a Grid alongside the Carbon Design System layout guidance. Namely, this PR adds support for Grid, Row, and Col components. Grid and Row are roughly the same layout containers, supporting various modes for "condensed" or "no gutter" moments. Column provides support for specifying responsive breakpoints using individual props, as demonstrated by the storybook story and tests. (mostly copied description)
All of this work started before @joshblack's PR #3892. I should have opened an issue sooner... I've mostly incorporated all of his PR, but notable differences of this PR include:
noGutterLeft
&noGutterRight
merged intonoGutter
as "left" and "right"classnames
function with params & avoids object key calcs for simplicitypropTypes
defines supported column span as specific numbersnoGutter
Changelog
New
Changed
Removed
Testing / Reviewing
The styles and examples come roughly from the Grid elements preview.