Clip camera
$349.00now $279.00
Shop tile: photos in an AspectRatio (a swipeable Carousel with dots when there are several), sale price, Badge and add-to-cart Button.
$349.00now $279.00
$129.00
import { ProductCard } from "@/components/blocks/product-card";type Product = { id: string; name: string; price: number; compareAt?: number; images: string[];};export function ProductGrid({ products, onAdd,}: { products: Product[]; onAdd: (id: string) => void;}) { return ( <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> {products.map((p) => ( <ProductCard key={p.id} name={p.name} price={p.price} compareAt={p.compareAt} badge={p.compareAt ? "Sale" : undefined} href={`/products/${p.id}`} media={p.images.map((src) => ( <img key={src} src={src} alt="" /> ))} onAddToCart={() => onAdd(p.id)} /> ))} </div> );}Shop tile: photos in an AspectRatio (a Carousel when there are several), name, price, badge, add button.
media*ReactNode[]Photos (<img>), one per slide. Several become a swipeable carousel with dots.
name*stringProduct name, the card's heading.
price*numberCurrent price in major units, e.g. 49.99.
addLabeldefault "Add to cart"ReactNodeAdd button text.
badgestringSmall label over the media, e.g. "New".
compareAtnumberStruck-through original price for a sale.
currencydefault "USD"stringISO 4217 code for the price.
hrefstringProduct page link for the name.
localedefault "en-US"stringBCP 47 locale for number formatting.
onAddToCart() => voidShows the add button; called when it is pressed.
ratiodefault 4 / 3numberMedia width/height, e.g. 1 for square.
| Prop | Type | Default |
|---|---|---|
media*Photos ( | ReactNode[] | — |
name*Product name, the card's heading. | string | — |
price*Current price in major units, e.g. 49.99. | number | — |
addLabelAdd button text. | ReactNode | "Add to cart" |
badgeSmall label over the media, e.g. "New". | string | — |
compareAtStruck-through original price for a sale. | number | — |
currencyISO 4217 code for the price. | string | "USD" |
hrefProduct page link for the name. | string | — |
localeBCP 47 locale for number formatting. | string | "en-US" |
onAddToCartShows the add button; called when it is pressed. | () => void | — |
ratioMedia width/height, e.g. 1 for square. | number | 4 / 3 |
* required. Every component also takes className.