Product Gallery
A product page's photos: a swipeable Carousel with arrows and a wrapping row of thumbnails, each a labeled button to its slide. One photo stays a plain picture.
import { ProductGallery } from "@/components/blocks/product-gallery";type Photo = { src: string; thumb: string; alt: string };export function ProductPhotos({ name, photos,}: { name: string; photos: Photo[];}) { return ( <ProductGallery label={`${name} photos`} media={photos.map((photo) => ( <img key={photo.src} src={photo.src} alt={photo.alt} /> ))} thumbnails={photos.map((photo) => ( <img key={photo.thumb} src={photo.thumb} alt="" /> ))} /> );}<ProductGallery>
A product page's photos: a swipeable Carousel with thumbnails under it. One photo stays a plain picture.
label requiredstringNames the gallery for screen readers, e.g. "Clip camera photos".media requiredReactNode[]Photos (<img>), one per slide.ratioDefault1numberMedia width/height, e.g. 1 for square.thumbnailsDefaultmediaReactNode[]Smaller versions for the row of thumbnails. Defaults tomedia.
| Prop | Type | Default |
|---|---|---|
label requiredNames the gallery for screen readers, e.g. "Clip camera photos". | string | — |
media requiredPhotos ( <img>), one per slide. | ReactNode[] | — |
ratioMedia width/height, e.g. 1 for square. | number | 1 |
thumbnailsSmaller versions for the row of thumbnails. Defaults to media. | ReactNode[] | media |
required
Every component also takes className.