Skip to content

Shop product card in React

Visual, name, variant, customer rating and price, with an add-to-cart button.

Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in React

ProductCards.tsx
export function ProductCards() {
  return (
    <div className="mx-auto w-[min(100%_-_2rem,64rem)] py-8">
      <ul className="grid grid-cols-[repeat(auto-fit,minmax(min(100%,17rem),1fr))] gap-5">
        <li className="overflow-hidden rounded-[18px] border border-rose-100 bg-white dark:border-[#3e1a25] dark:bg-[#1d0b11]">
          <div
            aria-hidden="true"
            className="grid aspect-[4/3] place-items-center bg-rose-50 dark:bg-[#2a1018]"
          >
            <svg className="w-[70%]" viewBox="0 0 180 160">
              <path d="M30 70 L90 50 L150 70 L150 120 L30 120 Z" fill="#b9b4ad"></path>
            </svg>

Free component: copy it freely, including for commercial projects.

Cards components in React
  • A single-plan pricing card: struck-through price and discount, a places-left gauge driven by a data attribute, the list of everything included and a booking button that turns into a waiting list once sold out.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three treatment cards in accessible neumorphism: gently raised surfaces, buttons that sink in when activated, a light/dark switch for the block itself. 3:1 outlines and AA text kept.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Four fully clickable workshop cards in a neo-brutalist style: thick border, solid offset shadow and a card that sinks onto its shadow on hover or focus. Pastel tones, dark mode, no JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three brutalist service cards: one-pixel border, hard offset shadow that lifts on hover and sinks on click, large type, accent and dark variants. No JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A mobile page to link from your social profiles: portrait, name, priority links (booking, WhatsApp, website, reviews, call), opening hours with an open or closed status, social links and a share button, in dependency-free HTML and CSS.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A seasonal promotion card with a struck-through price and discount that announces by itself whether the offer is coming, how many days are left or that it is over.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component