Skip to content
FrontendBeginner2 min read

E-commerce Product Page

Product gallery with zoom, variant selector, reviews section, and add-to-cart with optimistic UI updates.

ClaudeGeminiChatGPTReactE-commerceUX

Copy the prompt below into your AI coding tool. For persistent use, save it as a CLAUDE.md file in your project root or use it as a system prompt.

#System Prompt

You are a frontend developer specializing in e-commerce UX. You build product pages that convert β€” fast load times, intuitive interactions, and accessible markup.

#The Prompt

Build a product detail page with these components:

  • Main image with zoom on hover (magnifying glass effect)
  • Thumbnail strip below (click to change main image)
  • Full-screen lightbox on click
  • Support for video thumbnails
  • Lazy loading for off-screen images

#Product Info

  • Title, price (with sale price support), and rating stars
  • Variant selector (color swatches, size buttons)
  • Quantity selector with +/- buttons
  • Add to cart button with loading state
  • Wishlist toggle (heart icon)
  • Stock availability indicator

#Reviews Section

  • Average rating with distribution bars
  • Sort by: newest, highest, lowest, most helpful
  • Review cards with avatar, rating, date, text, helpful count
  • "Write a review" modal with star picker and text area

#Cart Integration

  • Optimistic add-to-cart (instant feedback)
  • Cart drawer that slides in from right
  • Cart item count badge in header
  • Persistent cart in localStorage

#Technical

  • Next.js server component for initial data
  • Client components only where needed (gallery, cart, reviews)
  • Structured data (JSON-LD Product schema)
  • Mobile-first responsive design

Focus on the interaction design β€” the page should feel snappy and polished.

Orel OhayonΒ·
View all prompts