Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Card examples · Standard

Image Card for React

A listing card with a full-width photo, bedroom, bathroom and area pills, and a price.

Framework
UI library

Property listings, product grids, portfolio pieces: sometimes the details matter as much as the picture. This React card puts a full-width photo between the title and a footer with three pills, bedrooms, bathrooms and area, each with an icon, and the price at the other end. Use it wherever people compare listings at a glance.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How does the photo reach the card's edges?

It sits in CardContent with p-0, which removes the side insets, and the card clips it to its rounded corners. The header and the footer keep their own padding.

How do I put the photo at the top instead?

Make the img the card's first child, before CardHeader. The card then drops its top padding and rounds the photo's top corners.

What are the three pills?

Each is a rounded-full border row with px-4 py-2: an icon (BedIcon, BathIcon, MaximizeIcon) and a text-sm value, 3, 2 and 240m². Each has a visually hidden name, so a screen reader hears Bedrooms: 3 rather than just 3.

How is the price laid out?

The footer is justify-between, with the pills on one side and the price, $425,000 in font-bold text-2xl, on the other. flex-wrap and gap-4 put the price on its own line when the card is too narrow.

How do I keep every photo the same shape?

The img has aspect-3/2 w-full object-cover, so any photo is cropped to 3:2 and cards in a grid line up. Change the ratio, such as aspect-video, to suit your pictures.

What should the image's alt say?

The demo leaves alt empty, so assistive tech skips the photo and the title names the listing. Describe the photo in alt when it shows something the text doesn't.