SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/tailwind-product-cards

6 Tailwind Product Cards

6 TailwindPublished 2026-10-04Free · no sign-up

Six e-commerce cards in Tailwind: a product card with rating and Add to cart, a sale card with old and new prices, a card with colour swatches, a card with hover actions, a cart line item and a featured product block.

01. Tailwind Product Card

TailwindE-commerce

A product card with an image area, name, rating, price and an Add to cart button. The rating is text with a star, the price uses tabular numbers, and the button names the product so screen readers hear Add Linen tote to cart.

View code
<article class="w-full max-w-[260px] rounded-2xl bg-white p-3 shadow-lg shadow-slate-900/10">
  <div class="aspect-square rounded-xl bg-gradient-to-br from-stone-200 to-stone-400"></div>
  <div class="px-1 pt-3"><h3 class="font-bold text-slate-900">Linen tote</h3><p class="text-sm text-slate-600"><span class="text-amber-600" aria-hidden="true">&#9733;</span> 4.8 <span class="text-slate-500">(212 reviews)</span></p>
    <div class="mt-3 flex items-center justify-between"><b class="text-lg tabular-nums text-slate-900">$32</b><button aria-label="Add Linen tote to cart" class="rounded-lg bg-slate-900 px-3 py-2 text-sm font-bold text-white hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900">Add to cart</button></div></div>
</article>

02. Tailwind Sale Product Card

TailwindSale

A product card on sale with a discount badge, the old price struck through and the new price highlighted. The old price is in an s element with hidden text saying Was, so screen readers read Was $120, now $90.

View code
<article class="w-full max-w-[260px] overflow-hidden rounded-2xl border border-slate-800 bg-slate-900">
  <div class="relative aspect-square bg-gradient-to-br from-orange-700 to-red-950"><span class="absolute left-3 top-3 rounded-md bg-red-500 px-2 py-1 text-xs font-extrabold uppercase text-white">-25%</span></div>
  <div class="p-4"><h3 class="font-bold text-white">Wool throw</h3><p class="mt-1 flex items-baseline gap-2"><s class="text-sm text-slate-400"><span class="sr-only">Was </span>$120</s><b class="text-lg text-white"><span class="sr-only">now </span>$90</b></p>
    <button class="mt-3 w-full rounded-lg bg-white py-2.5 text-sm font-bold text-slate-900 hover:bg-slate-200">Add to cart</button></div>
</article>

03. Tailwind Product with Colour Options

TailwindVariants

A product card with colour swatches as radio buttons, so shoppers can pick a variant before adding to cart. Each swatch has a hidden colour name and a ring when selected, using has-[:checked]: on its label.

View code
<article class="w-full max-w-[260px] rounded-2xl bg-white p-3 shadow-lg shadow-slate-900/10">
  <div class="aspect-square rounded-xl bg-gradient-to-br from-sky-200 to-sky-500"></div>
  <div class="px-1 pt-3"><h3 class="font-bold text-slate-900">Glass carafe</h3><b class="text-slate-900">$28</b>
    <fieldset class="mt-3 flex gap-2"><legend class="sr-only">Colour</legend>
      <label class="h-7 w-7 cursor-pointer rounded-full bg-sky-400 has-[:checked]:ring-2 has-[:checked]:ring-slate-900 has-[:checked]:ring-offset-2 has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-4 has-[:focus-visible]:outline-blue-600"><input type="radio" name="twc" class="sr-only" checked><span class="sr-only">Sky blue</span></label>
      <label class="h-7 w-7 cursor-pointer rounded-full bg-emerald-500 has-[:checked]:ring-2 has-[:checked]:ring-slate-900 has-[:checked]:ring-offset-2 has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-4 has-[:focus-visible]:outline-blue-600"><input type="radio" name="twc" class="sr-only"><span class="sr-only">Green</span></label>
      <label class="h-7 w-7 cursor-pointer rounded-full bg-amber-700 has-[:checked]:ring-2 has-[:checked]:ring-slate-900 has-[:checked]:ring-offset-2 has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-4 has-[:focus-visible]:outline-blue-600"><input type="radio" name="twc" class="sr-only"><span class="sr-only">Amber</span></label>
    </fieldset></div>
</article>

04. Tailwind Product with Hover Actions

TailwindHover

A product image that reveals Quick view and Wishlist buttons on hover and on focus-within, so keyboard users can reach them too. The buttons sit on the image with a translucent bar and fade in using group-hover: and group-focus-within:.

View code
<article class="group w-full max-w-[260px]">
  <div class="relative aspect-[4/5] overflow-hidden rounded-2xl bg-gradient-to-br from-violet-400 to-indigo-700">
    <div class="absolute inset-x-3 bottom-3 flex gap-2 opacity-0 transition group-hover:opacity-100 group-focus-within:opacity-100">
      <button class="flex-1 rounded-lg bg-white/90 py-2 text-sm font-bold text-slate-900 backdrop-blur">Quick view</button>
      <button aria-label="Add Velvet cushion to wishlist" class="grid w-10 place-items-center rounded-lg bg-white/90 text-slate-900">&#9825;</button>
    </div>
  </div>
  <h3 class="mt-3 font-bold text-white">Velvet cushion</h3><p class="text-slate-400">$45</p>
</article>

05. Tailwind Cart Line Item

TailwindCart

A product row as it appears in a cart: thumbnail, name, variant, quantity control and line price, with a remove link. The quantity input and remove button are named after the product, so several rows stay distinguishable.

View code
<div class="flex w-full max-w-md items-center gap-4 rounded-2xl border border-slate-200 bg-white p-3">
  <div class="h-16 w-16 shrink-0 rounded-xl bg-gradient-to-br from-rose-200 to-rose-400"></div>
  <div class="min-w-0 flex-1"><h3 class="truncate font-bold text-slate-900">Speckled mug</h3><p class="text-sm text-slate-600">Colour: Oat</p><button aria-label="Remove Speckled mug" class="text-sm font-semibold text-red-700 hover:underline">Remove</button></div>
  <input type="number" min="1" value="2" aria-label="Quantity of Speckled mug" class="w-14 rounded-lg border border-slate-300 px-2 py-1.5 text-center">
  <b class="w-14 text-right tabular-nums text-slate-900">$48</b>
</div>

06. Tailwind Featured Product

TailwindHero

A wide featured product block with the image on one side and details, price and two actions on the other, stacking on phones. It suits a homepage spotlight and uses md:grid-cols-2 for the two-column layout.

View code
<article class="grid w-full max-w-2xl overflow-hidden rounded-3xl border border-slate-800 bg-slate-900 md:grid-cols-2">
  <div class="min-h-[180px] bg-gradient-to-br from-emerald-500 to-teal-900"></div>
  <div class="p-6"><p class="text-xs font-bold uppercase tracking-wider text-emerald-300">New this week</p><h3 class="mt-1 text-2xl font-extrabold text-white">Forest dinner set</h3><p class="mt-2 text-sm leading-relaxed text-slate-400">Four plates and four bowls in a deep green glaze.</p><b class="mt-4 block text-2xl text-white">$140</b>
    <div class="mt-4 flex flex-wrap gap-2"><button class="rounded-lg bg-emerald-400 px-4 py-2.5 text-sm font-bold text-emerald-950">Add to cart</button><a href="#" class="rounded-lg border border-slate-600 px-4 py-2.5 text-sm font-bold text-white">Details</a></div></div>
</article>

About these Tailwind Product Cards

Name buttons after the product

On a grid of products, Add to cart buttons all look the same. An aria-label such as Add Linen tote to cart tells screen reader users which product each one adds.

Sale prices

Put the old price in an s element with hidden text Was and the new one with hidden text now, so the change reads clearly aloud.

Hover actions for keyboards

Actions revealed on hover must also appear on group-focus-within, or keyboard users can never reach them.

Numbers that align

tabular-nums keeps prices the same width so they line up in grids and cart rows.

Frequently asked questions

Do these need JavaScript?

No. Connect the buttons to your cart logic.

How do I show real product photos?

Replace the gradient blocks with img elements using object-cover and descriptive alt text.

Is there a CSS version?

Yes, see the CSS product cards collection.