Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Front view of the Summit bottle in ember orange, image 1 of 5
Northline
Summit Insulated Bottle
4.8 · 1,204 reviews
$38 · 750 ml
Keeps drinks cold for 24 hours and hot for 12. Leak-proof cap, powder-coated steel.
Installation
$ pnpm dlx shadcn@latest add @transition-kit/product-galleryUsage
import {
ProductGallery,
ProductGalleryMain,
ProductGalleryThumbnails,
} from "@/components/transitions/product-gallery";const images = [
{ id: "front", src: "/shoe-front.jpg", alt: "Front view" },
{ id: "side", src: "/shoe-side.jpg", alt: "Side view" },
{ id: "sole", src: "/shoe-sole.jpg", alt: "Sole detail" },
];
<ProductGallery images={images} className="max-w-sm">
<ProductGalleryMain />
<ProductGalleryThumbnails />
</ProductGallery>;const [index, setIndex] = useState(0);
<ProductGallery images={images} index={index} onIndexChange={setIndex}>
<ProductGalleryMain />
<ProductGalleryThumbnails />
</ProductGallery>;API Reference
ProductGallery
| Prop | Type | Default | Description |
|---|---|---|---|
images | ProductGalleryImage[] | - | Images available in the gallery. |
index | number | - | Controlled selected image index. |
defaultIndex | number | 0 | Initial selected index when uncontrolled. |
onIndexChange | (index: number) => void | - | Called with the target index after the new image decodes. |
ProductGalleryImage
| Field | Type | Default | Description |
|---|---|---|---|
id | string | - | Stable identity that pairs the hero and thumbnail images. |
alt | string | - | Image label used for the thumbnail name and the live-region announcement. |
src | string | - | Image URL rendered as an <img> with object-fit: cover. |
node | React.ReactNode | - | Custom content rendered instead of src; it should fill its box. |
ProductGalleryMain
| Prop | Type | Default | Description |
|---|---|---|---|
controls | boolean | true | Shows previous/next buttons over the image. |