Help: Specific layout with Grid/Flex that does not pop out under its max height #2480
-
Hey! I'm trying to do a specific layout together with React components. Here is a CodeSandbox to try it out: https://codesandbox.io/s/eloquent-hopper-0nczm?file=/src/App.tsx Imagine this page, done via grid (no scroll): The green box is a legend which is filled with categories. Inside the categories there are buttons (blue boxes): Take category 2 as an example: As soon as the buttons fill the height of the green box, they should take the next "column" (where box no. 5 starts now). In reality, they just fill up ONE column and therefore ignore the max height and just pop out under. How to I make them wrap/take the next column of their available space? These are components btw, so I don't want to hard-code the behavior of the categories/buttons. Any help is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Why not set the overall 3 part layout of your app with grid. Then use flexbox to cover the the button functionality at the bottom. You can then use flexbox wrap to achieve what you want (I think). |
Beta Was this translation helpful? Give feedback.
-
I think I got this working: In this bit remove the flex-1
And here:
Add h-full ... and that should do the trick. Cheers, |
Beta Was this translation helpful? Give feedback.
I think I got this working:
In this bit remove the flex-1
And here:
Add h-full
... and that should do the trick.
Cheers,
Martin.