Product Card

A storefront product tile with a square image, an optional corner badge like Sale or New, the product title, price and an Add to cart button when onAdd is set.

src/registry/ui/product-card.tsx/r/product-card.json

Installation#

bash
npx shadcn@latest add @minidev/product-card

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/product-card.json

Usage#

tsx
import { ProductCard } from "@/components/ui/product-card"

export function Example() {
  return (
    <ProductCard title="Studio plan" price="$49/mo" badge="Popular" onAdd={() => {}} />
  )
}

API reference#

ProductCard props
PropTypeDefault
title*string-
price*string-
imagestring-
badgestring-
onAdd() => void-
classNamestring-

* required

Dependencies#

npm

React only

Examples#

All e-commerce components

Learn more