ui icon indicating copy to clipboard operation
ui copied to clipboard

Cards

Open Jose-Maria-Martins opened this issue 1 year ago • 4 comments

are you guys thinking of posting components with images?

Jose-Maria-Martins avatar Jun 18 '23 19:06 Jose-Maria-Martins

Would be great to have some examples of cards with images for example product card

its-monotype avatar Jun 18 '23 19:06 its-monotype

Exactly! People love using cards with images, especially ecommerce and ranking websites.

Jose-Maria-Martins avatar Jun 18 '23 19:06 Jose-Maria-Martins

For anyone looking for it:

const CardImage = React.forwardRef<
  HTMLImageElement,
  React.ImgHTMLAttributes<HTMLImageElement>
>(({ className, ...props }, ref) => (
  <img ref={ref} className={cn("h-auto w-full", className)} {...props} />
));
CardImage.displayName = "CardImage";

Just add it into the card.tsx and use above CardHeader in the card. Also, I am adding "overflow-hidden" to my <Card>

mcgri avatar Nov 05 '23 20:11 mcgri

Full example?

biapar avatar Jun 18 '24 06:06 biapar

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jul 11 '24 23:07 shadcn