Product detailPro
Gallery that follows the color, variants with stock, quantity and add to cart.
What's inside
- Gallery follows color
- Sold-out sizes
- Quantity and add to cart
- Size validation
When to use
- Store product pages.
When not to use
- Product grids: use the product card.
Installation
Usage
Import it from @/components/blocks/product-detail after installing. It ships with sample data, so it renders straight away; swap in your own data when you're ready.
import { ProductDetail } from "@/components/blocks/product-detail";
export default function Page() {
return (
<main className="mx-auto max-w-6xl p-6">
<ProductDetail />
</main>
);
}API reference
ProductDetail
A product page with a gallery that follows the chosen color, sold-out sizes, quantity, validation and add to cart. Also the default export. No props: sample data sits at the top of the file, ready to swap for your own.
No props.
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Move through gallery, colors, sizes and cart |
| EnterorSpace | Choose an option |
Accessibility
- Colors and sizes are labelled radio groups; sold-out sizes are disabled and say so.
- Missing size shows an error with role="alert".
Motion
- Gallery images crossfade when the color changes.
Responsive behavior
- Gallery stacks above details below 768px.
Performance
- Use optimized images; only the active image is large.
Notes for AI
- Stock per size lives in the product object; keep it in sync with your inventory.
This page as Markdown, for assistants and coding agents:
/blocks/product-detail/markdownThe full library index for assistants is at /llms.txt.
Lode222 doc pagesllms.txt