skills/storefront-ui/product-page-design/SKILL.md
Design high-converting product detail pages with image galleries, variant selectors, social proof, and clear calls-to-action that drive add-to-cart
npx skillsauth add finsilabs/awesome-ecommerce-skills product-page-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build high-converting product detail pages (PDP) with zoomable image galleries, variant selectors (size, color, material), quantity controls, and social proof elements. This skill covers responsive layout patterns, platform-specific customization, and the component choices that drive conversion — from above-the-fold hero sections to sticky add-to-cart bars on mobile.
| Platform | Recommended Approach | Why | |----------|---------------------|-----| | Shopify | Use OS2.0 theme (Dawn, Sense, Craft) and customize via Theme Editor; extend with apps for reviews (Judge.me, Loox) and variant displays | Dawn's product template handles gallery, variants, and Add to Cart out of the box; Theme Editor lets merchants configure layout without code | | WooCommerce | Use WooCommerce's built-in product page with a well-supported theme (Astra, Kadence, Flatsome) + Storefront Customizer; extend with YITH, WooCommerce Product Add-Ons, and WP Review plugins | WooCommerce provides the gallery, variants (attributes + variations), and cart button natively; theme selection determines layout quality | | BigCommerce | Customize the Cornerstone theme's product page via Theme Editor; use BigCommerce's built-in review system and extend with Shogun for advanced layout control | Cornerstone covers all core PDP components; BigCommerce's Theme Editor exposes layout options without code | | Custom / Headless | Build a two-column grid layout with a gallery component, variant selector, sticky add-to-cart bar, and structured data for SEO | Full control over every component and interaction; see patterns below |
Layout configuration (Theme Editor):
Adding reviews (most important social proof element):
Improving variant selectors for visual products (colors/sizes):
Stock urgency indicator:
Layout configuration:
Theme-level layout:
Adding reviews:
Variant selectors (color swatches, size buttons):
Layout configuration (Cornerstone theme):
Reviews:
Social proof apps:
Two-column responsive PDP layout:
.pdp-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
}
@media (max-width: 768px) {
.pdp-grid { grid-template-columns: 1fr; }
}
/* Gallery sticks while scrolling through product info on desktop */
.pdp-gallery { position: sticky; top: 2rem; align-self: start; }
Variant selector with availability tracking:
// VariantSelector.jsx — uses radio inputs for accessibility
function VariantSelector({ product, selectedOptions, onOptionChange }) {
function isAvailable(optionName, value) {
return product.variants.some(v =>
v.options[optionName] === value &&
v.inventory > 0 &&
Object.entries(selectedOptions).every(([k, sv]) =>
k === optionName || v.options[k] === sv
)
);
}
return (
<div className="variant-selector">
{product.optionNames.map(optionName => (
<fieldset key={optionName}>
<legend>{optionName}: <strong>{selectedOptions[optionName]}</strong></legend>
{product.optionValues[optionName].map(value => (
<label key={value} className={!isAvailable(optionName, value) ? 'unavailable' : ''}>
<input type="radio" name={optionName} value={value}
checked={selectedOptions[optionName] === value}
disabled={!isAvailable(optionName, value)}
onChange={() => onOptionChange(optionName, value)}
className="sr-only" />
<span className="option-btn">{value}</span>
{!isAvailable(optionName, value) && <span className="sr-only"> (out of stock)</span>}
</label>
))}
</fieldset>
))}
</div>
);
}
Sticky Add to Cart bar (appears when primary button scrolls out of view):
function StickyBuyBar({ product, selectedVariant, onAddToCart }) {
const [visible, setVisible] = useState(false);
useEffect(() => {
const el = document.getElementById('main-add-to-cart');
if (!el) return;
const obs = new IntersectionObserver(([e]) => setVisible(!e.isIntersecting));
obs.observe(el);
return () => obs.disconnect();
}, []);
return visible ? (
<div className="sticky-buy-bar" role="complementary" aria-label="Add to cart">
<span>{product.name}</span>
<span>${selectedVariant?.price ?? product.price}</span>
<button onClick={onAddToCart} disabled={!selectedVariant || selectedVariant.inventory <= 0}>
{selectedVariant?.inventory <= 0 ? 'Sold Out' : 'Add to Cart'}
</button>
</div>
) : null;
}
Product structured data for SEO (JSON-LD):
// Build server-side to avoid client-side injection
function buildProductSchema(product, reviews) {
return {
'@context': 'https://schema.org',
'@type': 'Product',
name: product.name,
image: product.images.map(i => i.src),
description: product.description,
sku: product.sku,
brand: { '@type': 'Brand', name: product.brand },
offers: {
'@type': 'AggregateOffer',
lowPrice: Math.min(...product.variants.map(v => v.price)).toFixed(2),
priceCurrency: 'USD',
availability: product.inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
},
...(reviews.totalCount > 0 && {
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: reviews.averageRating.toFixed(1),
reviewCount: reviews.totalCount,
},
}),
};
}
Regardless of platform, these elements directly improve add-to-cart conversion:
<fieldset>/<legend>/<input type="radio"> pattern, not clickable <div> elements; screen readers navigate by thisloading="eager"; thumbnails and secondary images use loading="lazy"| Problem | Solution |
|---------|----------|
| CLS from image loading | Set explicit width and height on images, or use aspect-ratio on the container |
| Variant selector doesn't update the URL | Use replaceState to update the URL with the selected variant ID so the page is shareable |
| Add-to-cart button hidden on long pages (mobile) | Implement a sticky add-to-cart bar that appears when the main button scrolls out of view |
| Gallery images load slowly on mobile | Serve responsive images with srcset and use WebP/AVIF formats |
| Reviews section causes long initial load | Lazy-load reviews — initialize the section only when the user scrolls near it |
tools
Let shoppers save products to a wishlist, share it with friends, and get notified when saved items come back in stock or drop in price
development
Build a themeable storefront with design tokens and CSS custom properties that supports white-labeling, multi-brand variants, and dark mode
development
Speed up product discovery with instant search suggestions, fuzzy typo matching, and category-aware results powered by Algolia or Elasticsearch
development
Build a mobile-first storefront with thumb-friendly navigation, sticky add-to-cart buttons, and touch-optimized components for high mobile conversion