Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Create CGridItem component for v0.x core #403

IHIutch started this conversation in Ideas
Discussion options

Is your feature request related to a problem? Please describe.
I noticed the React library has a GridItem component, this seems helpful for configuring column spans and such. I am much more of a bootstrap person, so I'm used to classes like col-md-8, offset-md-8...

Describe the solution you'd like
A component that accepts props like colSpan, colStart, colEnd...
See: https://chakra-ui.com/docs/layout/grid#griditem-props

Describe alternatives you've considered
I've created my own component that handles inline styles for the above-mentioned props.

Additional context
If there is a way to do this already, please let me know. I tried searching issues for "Grid Item", but there is nothing. If a solution exists, maybe it can just be added to the docs?

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Hey @IHIutch Thanks for the feature request!

Currently v0 doesn't implement this as a component. I don't see any harm in adding a component like this to the project. However, I'm not yet sure if it should be implemented in the v0 library core, as a recipe, or in user land as a custom component. Your points are pretty good ones. 🤔 I haven't yet encountered this use case yet.

Since I'm not really sure which exact direction to take, I'm happy to covert this issue into a discussion if you have some more ideas or if other users may feel the same way so as to add this to the core v0 library.

You must be logged in to vote
3 replies
Comment options

This maybe is a little easier than I thought it would be, looking at how it works in the React lib

It turns out grid-column-start and grid-column-end props work on CBox, which basically does everything you'd want. (I just find grid-column-end incredibly confusing, so I much prefer "col-span" 😅) So maybe just adding that to the docs is enough?

That being said, it seems rather straightforward to create this component, so I can take a stab at it? Let me know if you think it's valuable to do for v0 otherwise, I can try making it for v1.

Comment options

Cool. I'm open to the idea! Feel free to send in a PR! We love PRs 😀

At the moment I'm focusing my efforts on v1 and keeping things moving on there so I'm happy to have you take a stab at this 🎉

Comment options

Okay, I started this here. This is a little more than I've done so far, so I'd appreciate your thoughts on organizing things a bit better.

And if you have any direction for tests and updates to the docs, I'll update those as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
Converted from issue

This discussion was converted from issue #351 on March 14, 2021 10:24.

AltStyle によって変換されたページ (->オリジナル) /