Component

Product Card

E-commerce product card with image zoom, badges, ratings, and quick actions. Perfect for online stores.

  • Component
  • Tailwind
  • HTML
  • MIT

What it does

Capabilities

  • Image hover zoom
  • Badges
  • Star ratings
  • Wishlist button
  • Add to cart

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.site/library/tailwind/components/cards/product-card/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Cards/product-card
registry path: Tailwind/Components/Cards/product-card

Source

Implementation

code.html
<article class="group bg-white rounded-2xl overflow-hidden border border-gray-100 shadow-sm hover:shadow-xl transition-all duration-300">
  <div class="relative overflow-hidden">
    <img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=600&h=400&fit=crop" alt="Premium Wireless Headphones" class="w-full h-56 object-cover group-hover:scale-105 transition-transform duration-500">
    <div class="absolute top-4 left-4 flex gap-2">
      <span class="px-3 py-1 bg-white/90 backdrop-blur text-xs font-semibold text-gray-900 rounded-full">NEW</span>
      <span class="px-3 py-1 bg-red-500 text-xs font-semibold text-white rounded-full">-20%</span>
    </div>
    <button class="absolute top-4 right-4 p-2.5 bg-white/90 backdrop-blur rounded-full opacity-0 group-hover:opacity-100 translate-y-2 group-hover:translate-y-0 transition-all hover:bg-white">
      <svg class="w-5 h-5 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
      </svg>
    </button>
  </div>
  
  <div class="p-5">
    <div class="flex items-center gap-1 mb-2">
      <svg class="w-4 h-4 text-amber-400 fill-current" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/></svg>
      <span class="text-sm font-medium text-gray-700">4.9</span>
      <span class="text-sm text-gray-400">(2,847)</span>
    </div>
    
    <h3 class="font-semibold text-gray-900 mb-1 group-hover:text-blue-600 transition-colors">Premium Wireless Headphones</h3>
    <p class="text-sm text-gray-500 mb-3">Active noise cancellation • 40h battery</p>
    
    <div class="flex items-center justify-between">
      <div class="flex items-baseline gap-2">
        <span class="text-xl font-bold text-gray-900">$249</span>
        <span class="text-sm text-gray-400 line-through">$299</span>
      </div>
      <button class="px-4 py-2 bg-gray-900 text-white text-sm font-medium rounded-lg hover:bg-gray-800 transition-colors">
        Add to Cart
      </button>
    </div>
  </div>
</article>
35 lines UTF-8 · LF · Spaces: 2
DevSnips AI ready Claude · Cursor · Windsurf

Agent skill & Model Context Protocol

Pass this component straight into your AI workflow. DevSnips exposes each resource as a structured, addressable registry entry, so your agent installs the real files instead of approximating them.

devsnips://components/cards/product-card
Prompt instruction
I want to use this DevSnips resource in production:

Page:
https://devsnips.site/library/tailwind/components/cards/product-card/

Install: npx devsnips add
Tailwind/Components/Cards/product-card

This is the Product Card — E-commerce product card with image zoom, badges, ratings, and quick actions. Perfect for online stores.

Use this DevSnips resource as the starting point for my project.
Adapt it to my project's stack and conventions, fix any issues,
and make it production-ready while preserving its intended design
and behavior.

Paste into ChatGPT, Claude or your agent — it already carries the page URL and the exact install path.

Resource URI
devsnips://components/cards/product-card