ui
ui copied to clipboard
Cards
are you guys thinking of posting components with images?
Would be great to have some examples of cards with images for example product card
Exactly! People love using cards with images, especially ecommerce and ranking websites.
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>
Full example?
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.