mui-toolpad icon indicating copy to clipboard operation
mui-toolpad copied to clipboard

Support Card component

Open prakhargupta1 opened this issue 2 years ago • 8 comments

Summary 💡

https://mui.com/material-ui/react-card/

Benchmarks

  • https://blocks.tremor.so/blocks/kpi-cards

prakhargupta1 avatar Aug 05 '22 17:08 prakhargupta1

What's the user's expectation for this component? Should we allow user to build custom cards using individual card sub-components that MUI support, or should we use one predefined card layout, i.e.: CleanShot 2022-12-23 at 14 59 25@2x

CleanShot 2022-12-23 at 15 00 39@2x

Or something else?

bytasv avatar Dec 23 '22 13:12 bytasv

The numbers on a dashboard can be in a card component, like Stats #2025

Eg: Screenshot 2022-12-23 at 6 33 53 PM

https://marmelab.com/ra-enterprise-demo/#/

prakhargupta1 avatar Dec 23 '22 13:12 prakhargupta1

Would expect that you can drag and drop different card sub-components on the canvas to build the layout of your own or should we have some predefined layouts:

  1. I.e. we allow users to drag Card, CardHeader, CardNumber, etc... components onto the canvas
  2. We provide only Card component, but it has prop to control layout and props for different values

bytasv avatar Dec 23 '22 14:12 bytasv

We can provide a basic template constituting header, content and action.

Furthermore, adding/removing sub-components should be allowed. And these sub-components will be the existing components from the catalog. Later on, adding icon on a card would also be possible. When a user will click on a sub-component then it's props will show up in the right panel. Eg: Retool.

prakhargupta1 avatar Dec 24 '22 06:12 prakhargupta1

Q1. Should we replace Paper with Card? I doubt paper component will be used too much, also card component is build over paper component. Instead of paper, I think users would be interested in a Container/box type of component for scenarios where they want to club components together. Eg: Show button and data grid together. I had been using paper for this use case.

Q2. What difference does it make if I use card media vs I drag image component and use it as a sub-component of card?

prakhargupta1 avatar Jan 04 '23 11:01 prakhargupta1

Q1. Should we replace Paper with Card? I doubt paper component will be used too much, also card component is build over paper component. Instead of paper, I think users would be interested in a Container/box type of component for scenarios where they want to club components together. Eg: Show button and data grid together. I had been using paper for this use case.

Q2. What difference does it make if I use card media vs I drag image component and use it as a sub-component of card?

Q1: The Card component would be pretty different from the Paper component we have in my opinion, so maybe it makes sense to keep both... But it's true that maybe people won't use the Paper component a lot. But yes, right now the Paper component is the only component we have that allows us to compose layouts, so it would definitely be a good idea to have a more generic component to do that.

Q2: I'm not sure how much our current Image component is ready to be used in Cards - probably the images added with CardMedia are more suited to be used in a Card component and look good. But with enough work I guess that both approaches should be possible?

apedroferreira avatar Jan 04 '23 13:01 apedroferreira

About Q1 here, I just realized that if we allow dragging-and-dropping into the Card component it could actually be almost exactly like our current Paper component... In that case we shouldn't have both.

apedroferreira avatar Jan 05 '23 12:01 apedroferreira

About Q1 here, I just realized that if we allow dragging-and-dropping into the Card component it could actually be almost exactly like our current Paper component... In that case we shouldn't have both.

Yes, paper component is not in any of the other tools. Most likely because of what you mentioned. So, I think changing paper to card makes sense as it will allow more card props available to be used.

prakhargupta1 avatar Jan 06 '23 07:01 prakhargupta1