How to expand the ResizablePanelGroup to take 100% available height. #2502
Replies: 5 comments 5 replies
-
Confirming this unexpected height behavior. The Resizable Panel Group and Panels do not seem responsive to relatively declared heights like height: 100% or min-height: x. I am only able to set a fixed height on these elements. I've tried to use a Panel Group in a similar way to the way you are using it. Mine contains a chart that is rendered after data is fetched, so I'd prefer the Panel Group to keep a minimum height until the chart renders, then be able to grow with the size of the content. In the end, I put a height on the panel that contains the chart and gave the chart a fixed height as well so that after rendering, the chart more or less fits in the panel. Because the Panel Group was horizontal, the height of the first panel determined the height of the entire Panel Group. This is not ideal. Notice how in this example from the shadcn ui site, the first panel has a fixed height? Maybe we must use a fixed height for some reason I don't understand yet.
I'm following your question to see how/if you solve this. |
Beta Was this translation helpful? Give feedback.
-
I had a similar scenario to you where I have a header and then the Resizable panels. In my layout the page has 100vh and the then the header has a set height and the Resizable panel group then takes up the remainder. To do this I used Here's a link to the source code component I'm referring to: DesktopEditor. And here is a link to the live project: QuantumQuill |
Beta Was this translation helpful? Give feedback.
-
add className="min-h-screen" to your ResizablePanelGroup |
Beta Was this translation helpful? Give feedback.
-
What worked for me was setting the parent of the ResizablePanelGroup component to: |
Beta Was this translation helpful? Give feedback.
-
Two Important Classe "relative [&>*]:h-full"Note: Adding only relative or wrapping children in div doesn't seem right approach either as if you console, RadixPrimitive has children with class table, to which we have to give h-full; to access that children use [&>*]:h-full. Hope this helps
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am stuck in a middle of CSS issue with
ResizablePanelGroup
component. In my page layout I am trying to place a header and aResizablePannelGroup
with4 pannels
. Page should have a100vh and within that I want to place other components. After placing Header myResizablePannleGroup
should expand the rest of the height available in the space without manually specifying a height. Only the Content I am putting in theResizablePannel
should be scrollable when they exceed the space available in the pannel.Above is the current status of the layout and red are should expand the rest of the height available.
Kind of the expectation I want. ResizablePannelGroup expand in the green color space and inner pannels have scrollable views when the available space exceeds
Beta Was this translation helpful? Give feedback.
All reactions