Repeating cards with dynamic data #1242
-
Hello! I am not sure if it is a bug or I am simply using it wrong but I've noticed when I populate cards by JS map, it won't make space between vertical cards and saw some other weird stuff. What I want to do:make equal-height-cards with map in responsive What I have tried and failed:
Could you please tell me how I am supposed to do this, to keep margin bottom + equal height + responsive with dynamic data? Thank. you very much in advance! Sample code
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @shyamajp Thanks for posting this question here, and providing code examples and screenshots. Your first solution is super close. Because we need to wrap the Card in the extra Box, the Card won't stretch to 100% height by default. In order to solve for that, we can add https://codesandbox.io/s/icy-leaf-m2w5x?file=/src/index.tsx Let us know if that works for you. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi @shyamajp
Thanks for posting this question here, and providing code examples and screenshots. Your first solution is super close. Because we need to wrap the Card in the extra Box, the Card won't stretch to 100% height by default. In order to solve for that, we can add
display="flex"
to the box, which make the inner Cards to stretch. Here's a CodeSandbox to show the solution working. I added a comment where I added the display prop.https://codesandbox.io/s/icy-leaf-m2w5x?file=/src/index.tsx
Let us know if that works for you. Thanks!