-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Allow PageContainer Children to Fully Utilize Viewport Height #4324
Comments
PageContainer should behave as a Container component, but with a header. I believe the original Container could be made to behave this way with an Are you interested in contributing a fix? |
Yes, this is possible to do directly inside the We probably need to add styles to the But an Feel free to try to create a PR, or we can create one later! |
I would also like to vote for this feature. I looked into the source code - the PageContainer renders child Stacks, divs and a parent Container, so even if we modify the PageContainer with sx, this is not passed down to those children. Those child divs won't inherit height 100%, so my own component's height 100% is ignored. It would be great to either add this as a prop to PageContainer or have a separate FullHeightPageContainer component with min-height set to 100% or 100vh etc. |
I think where we potentially could go with this is to extract a PageHeader component out of what is now PageContainer and let users wrap it themselves (or not) with a Material UI Container. Then deprecate that PageContainer altogether. Would that make sense? |
@Janpot that would still introduce an issue of having to calculate the |
Or keep it and just export the PageHeader. I think PageContainer "as is" is great and simple. Has nice defaults. It's just not overridable enough - in that case would be better to pick and choose only what we need (the whole header with title and breadcrumbs, in our case). We have around 10 pages so far, and only 3 pages are "full screen". The rest is using PageContainer as is and we like it. |
would it? You should still be able to write your own container, give it 100% height, and put header with one more div into it (this div also has 100% height), no? |
Should be straightforward with a flex layout. In any case, we wouldn't make this change without a demo of this use-case in the docs. |
Summary
It appears that the children of a PageContainer cannot fully utilize the entire height of the visible viewport (i.e., 100% height). It would be beneficial to either add a prop or redesign the component to enable this functionality. If achieving this with the sx prop is already possible, please let me know, and consider documenting this feature.
Examples
Motivation
This design is commonly found in web applications.
Search keywords: full height
The text was updated successfully, but these errors were encountered: