Componentdata1.04 KB gzipZero dependencies

Product Card

Product card with image slot, price, discount badge and wishlist heart.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add product-card

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { ProductCard } from "@/components/ui/product-card"; <ProductCard />

Source code

product-card.tsx + 1 helper

Zero 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 />
PropTypeDescription
titlestringPrimary heading or title text.
pricestringConfigures price.
originalPricestringConfigures original price.
imagestringConfigures image.
discountnumberConfigures discount. (Default: 0)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.
onAddToWishlist() => voidCallback invoked on add to wishlist.