Atelier UI

搜索组件…

搜索组件…

Product Card

商品卡片,含角标、评分星、划线价、加入购物车状态切换与心愿单收藏按钮。

在沙盒中编辑

复制一段给 AI 编程工具的提示词,包含源码、依赖和用法

属性

ProductCardProps

同时支持以下类型的全部属性: Omit<React.ComponentProps<"div">, "title">

属性类型默认值说明
name* 必填string——
price* 必填number——
originalPricenumber—Original price, shown with a strikethrough
rating* 必填number—0-5, supports halves visually by rounding
reviewsnumber——
badgestring—e.g. "New" or "-20%"
imageClassNamestring"from-amber-300 via-orange-400 to-rose-500"Tailwind gradient utilities for the image placeholder
currencystring"$"—
onAddToCart(added: boolean) => void——
onWishlistChange(wished: boolean) => void——

安装

$ npx shadcn@latest add https://chromotion.dev/r/product-card.json

同类组件