Skip to content
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

[docs] Instructions in Grid v1 not specified in Grid v2 #44759

Closed
ccowen opened this issue Dec 13, 2024 · 13 comments · Fixed by #44820
Closed

[docs] Instructions in Grid v1 not specified in Grid v2 #44759

ccowen opened this issue Dec 13, 2024 · 13 comments · Fixed by #44820
Assignees
Labels
component: Grid The React component. docs Improvements or additions to the documentation support: docs-feedback Feedback from documentation page support: Stack Overflow Please ask the community on Stack Overflow

Comments

@ccowen
Copy link

ccowen commented Dec 13, 2024

Related page

https://mui.com/material-ui/react-grid2/

Kind of issue

Unclear explanations

Issue description

I'm having trouble with Grid2, with a couple of things. I want a container to take up 100% height of a page. I also want to create a Grid item that is centered vertically. I would easily be able to apply this in Grid1, which is on the documentation page, with

alignItems: "center", /* "center" to center elements vertically, or "stretch" to stretch the height to fill the space*/

I am unsure if i am supposed to accomplish this another way. In Grid v1 these instructions are specified, but I am unable to learn how to apply this for Grid v2. Heught is not meentioned on this page at all. I have looked into incorporating other components but am lost.

Context

I would like these features explained in v2 as they are presented in Grid v1.

Search keywords: Grid v2, height, stretch

@ccowen ccowen added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Dec 13, 2024
@siriwatknp
Copy link
Member

I would easily be able to apply this in Grid1, which is on the documentation page, with
alignItems: "center", /* "center" to center elements vertically, or "stretch" to stretch the height to fill the space*/

Can you point me to that section? I can add it to the Grid 2 docs if it's missing.

FYI, you can achieve the same with sx prop:

<Grid2 sx={{ alignItems: 'center' }}>

@siriwatknp siriwatknp added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 16, 2024
@ccowen
Copy link
Author

ccowen commented Dec 18, 2024

Thank! Yes, I am referring to https://mui.com/material-ui/react-grid/ under Interactive section. Thanks for that code snippet, that applied but I am also looking to justtifyContent: "center" and it is not applying. I am trying multiple things and am not getting it. I want to make a Grid as pictured (from v1 Grid docs)

Screen Shot 2024-12-18 at 2 49 04 PM

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Dec 18, 2024
@zannager zannager added the component: Grid The React component. label Dec 19, 2024
@DiegoAndai
Copy link
Member

@siriwatknp, let's add the interactive demo and ensure that all functionalities from Grid v1 are achieved. Adding "ready to take" in case anyone has time to open a PR before we do.

@DiegoAndai DiegoAndai added ready to take Help wanted. Guidance available. There is a high chance the change will be accepted and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 19, 2024
@DiegoAndai DiegoAndai moved this to Selected in Material UI Dec 19, 2024
@DiegoAndai DiegoAndai added the docs Improvements or additions to the documentation label Dec 19, 2024
@yash49
Copy link
Contributor

yash49 commented Dec 20, 2024

Hey @DiegoAndai, @siriwatknp
I would like to work on this

@DiegoAndai
Copy link
Member

Hey @yash49! Sure 😊, go ahead. Let me know if you need any help. Thanks in advance.

@yash49
Copy link
Contributor

yash49 commented Dec 23, 2024

Hey @siriwatknp @DiegoAndai
please review the PR #44820

@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Dec 23, 2024
@DiegoAndai DiegoAndai moved this from Selected to In progress in Material UI Dec 23, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Material UI Dec 24, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@ccowen How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@DiegoAndai
Copy link
Member

Hey @ccowen! We recently added a demo that shows that all positioning options in Grid v1 work for Grid v2. It's not deployed yet but you can check it out here: https://deploy-preview-44820--material-ui.netlify.app/material-ui/react-grid2/#interactive

In other words, whatever that can be achieved in the Grid v1 interactive demo is also achievable in Grid v2.

If the demo is not enough to fix your issue, please reach out with a minimal reproduction. With a minimal reproduction, I could try to debug your issue specifically. A live example would be perfect. This StackBlitz sandbox template may be a good starting point. Thank you!

@DiegoAndai DiegoAndai reopened this Dec 24, 2024
@DiegoAndai DiegoAndai moved this from Done to Waiting for response in Material UI Dec 24, 2024
@DiegoAndai DiegoAndai added the status: waiting for author Issue with insufficient information label Dec 24, 2024
@DiegoAndai DiegoAndai removed the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Dec 24, 2024
@ccowen
Copy link
Author

ccowen commented Dec 26, 2024

Thank y'all very much for working on this! I am still having trouble. Hoping we can look at the demo option @DiegoAndai .

I am coding the framework for content on this page. Here is the demo code, https://stackblitz.com/edit/stackblitz-starters-f8vs8m1c?file=src%2FApp.tsx

This is what i'm trying to create, (though this is not on a Grid here, not looking for pixel perfect):
Screen Shot 2024-12-26 at 2 06 24 PM

Same image with outlines of 'containers'
Screen Shot 2024-12-26 at 2 06 24 PM copy

I think I am having issues when items become containers, and getting a Grid item to full up vertical space. I used 100vh but I was not happy with that solution.

I started with the left side and have sample text 'test test test' where I want the content in the yellow left rectangle to go. I am unable to create vertically centered elements, aka space where I put yellow arrows.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Dec 26, 2024
@DiegoAndai
Copy link
Member

Hey @ccowen, I think the best approach here would be to use a combination of Stack and Grid, here's an initial implementation from your sandbox: https://stackblitz.com/edit/stackblitz-starters-v5rpudmu?file=src%2Fstyle.css,src%2Findex.tsx,src%2FHomePage.tsx

For further help, I would suggest you reach out to our StackOverflow community. I won't be able to provide further guidance here. I hope you're able to implement your site 😊.

@github-project-automation github-project-automation bot moved this from Waiting for response to Done in Material UI Dec 27, 2024
@DiegoAndai DiegoAndai added support: Stack Overflow Please ask the community on Stack Overflow and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 27, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@ccowen How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Copy link

👋 Thanks for using this project!

We use GitHub issues exclusively as a bug and feature requests tracker, however, this issue appears to be a support request.

For support with Material UI please check out https://mui.com/material-ui/getting-started/support/. Thanks!

If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024
@ccowen
Copy link
Author

ccowen commented Dec 28, 2024

Hey @ccowen, I think the best approach here would be to use a combination of Stack and Grid, here's an initial implementation from your sandbox: https://stackblitz.com/edit/stackblitz-starters-v5rpudmu?file=src%2Fstyle.css,src%2Findex.tsx,src%2FHomePage.tsx

For further help, I would suggest you reach out to our StackOverflow community. I won't be able to provide further guidance here. I hope you're able to implement your site 😊.

Thank you! This is really helpful. I was thinking I knew how to do this in Grid1 and not Grid2. The stack overflow seems heelpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Grid The React component. docs Improvements or additions to the documentation support: docs-feedback Feedback from documentation page support: Stack Overflow Please ask the community on Stack Overflow
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants