themeocean

Product Card

Galleries

About

A product card with an image gallery, colour and size pickers, quantity stepper, wishlist heart and an Add to cart button that shows adding and added states. Includes built-in SVG artwork, so it works with no image files.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Product Card to your project and fits it to your theme.

Code

How Product Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// This is a file with a demo for your component
// That's what users will see in the preview
// Create new files in this directory to add more demos

"use client";

import * as React from "react";
import { Component, type CartSelection } from "@/components/ui/product-card";

export default function DemoOne() {
  const [last, setLast] = React.useState("");

  return (
    <div className="flex min-h-[640px] w-full flex-col items-center justify-center gap-5 bg-background px-4 py-12 text-foreground">
      <Component
        onAddToCart={async (item: CartSelection) => {
          // Pretend the server takes a moment
          await new Promise((resolve) => setTimeout(resolve, 600));
          setLast(item.quantity + " x size " + item.size + " (" + item.colorId + ")");
        }}
      />
      <p className="h-5 text-sm text-muted-foreground" role="status">
        {last ? "Cart updated: " + last : ""}
      </p>
    </div>
  );
}

Dependencies

More by themeocean

View all
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    781
  • Floating Glassmorphic Navbar with Morphing Pill Indicator

    Floating Glassmorphic Navbar with Morphing Pill Indicator

    88
  • Mac-Style Floating Dock

    Mac-Style Floating Dock

    79
  • Nexus 3D Animated Login - Futuristic Authentication UI

    Nexus 3D Animated Login - Futuristic Authentication UI

    72
  • Animated 3D Perspective Hero with Floating Glass Layers

    Animated 3D Perspective Hero with Floating Glass Layers

    51
  • Interactive AI Agent Workflow Node Card

    Interactive AI Agent Workflow Node Card

    39
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    31
  • Interactive AI Voice Assistant Audio Visualizer

    Interactive AI Voice Assistant Audio Visualizer

    24

More in Galleries

View all
  • Gallery Component

    Gallery Component

    49
  • Photo Deck

    Photo Deck

    82
  • Scattered About

    Scattered About

    83
  • Product Hover Showcase

    Product Hover Showcase

    123
  • Morph Gallery

    Morph Gallery

    5
  • About 3

    About 3

    460
  • File Upload

    File Upload

    22
  • Editorial Collage Hero

    Editorial Collage Hero

    530