Componentdata1.04 KB gzipZero dependencies
Product Card
Product card with image slot, price, discount badge and wishlist heart.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add product-cardOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { ProductCard } from "@/components/ui/product-card"; <ProductCard />Source code
product-card.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxproduct-card.tsx89 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ProductCardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> { title: string; price: string; originalPrice?: string; image?: string; discount?: number; className?: string; onAddToWishlist?: () => void;} const badgeClass = "absolute -top-1.5 -right-1.5 rounded-xs bg-destructive text-white text-xs font-bold uppercase tracking-widest px-1.5 py-0.5"; export function ProductCard({Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { ProductCard } from "@/components/ui/product-card"; <ProductCard />| Prop | Type | Description |
|---|---|---|
| title | string | Primary heading or title text. |
| price | string | Configures price. |
| originalPrice | string | Configures original price. |
| image | string | Configures image. |
| discount | number | Configures discount. (Default: 0) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |
| onAddToWishlist | () => void | Callback invoked on add to wishlist. |