Height and width for the Card component #1416
-
Hello, I just came across a recent design that I'm trying to implement as shown in attachment. I was wondering if there was a reason not to provide height and width for the card component. It's hard to provide precise widths and heights to grid. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hey @jaymehta1986, thanks for starting a Discussion on this. In general, our stance is that components should not be concerned with layout. There are a few reasons that setting fixed sizes (especially height) on components is a bad idea:
Any of the above could cause content overflow of components. Because of this, we recommend placing components inside of layouts (using 100% width on the components) and letting the contents dictate the size of the components. To get a better sense of how we can help you with your layout, it would be great to get some more context. What are you trying to achieve? Once we understand what your expected outcome is, we can provide more specific guidance. |
Beta Was this translation helpful? Give feedback.
-
Hi @mindytom & @jaymehta1986, I made a sample of how we believe Cards can be used for maximum flexibility: https://codesandbox.io/s/how-to-layout-cards-fnu66?file=/src/index.tsx. Please let me know if this helps! |
Beta Was this translation helpful? Give feedback.
Hi @mindytom & @jaymehta1986,
I made a sample of how we believe Cards can be used for maximum flexibility: https://codesandbox.io/s/how-to-layout-cards-fnu66?file=/src/index.tsx. Please let me know if this helps!