YoucefBnm Bnm

Product Gallery

Galleries 4

About

# Component for product images with zoom interactions ## Features - ๐Ÿ–ผ๏ธ Dynamic image preview with zoom and pan - ๐Ÿ‘† Interactive thumbnail navigation - โŒจ๏ธ Keyboard navigation support - ๐Ÿ” Image zoom controls - ๐ŸŽฏ Touch-friendly interactions - โ™ฟ Accessible by default

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Product Gallery to your project and fits it to your theme.

Code

How Product Gallery is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client" 

import * as React from "react"
import { ProductGallery, Controls, ProductGalleryPreviewImage, ProductGalleryThumb, ProductGalleryThumbsWrap } from "@/components/ui/product-gallery"

const PRODUCT_IMAGES = [
  "https://cdn.21st.dev/assets/mirror/ac/ac31da27c421d1240b5add1011866c68c23fd988e3412d999c70943ca2468fb5.jpg",
  "https://cdn.21st.dev/assets/mirror/73/7365e182be8c7ab5d86a1b5f578be2e25e59d5def4d7e5a37890d452b56d9963.jpg",
  "https://cdn.21st.dev/assets/mirror/56/5683c49cc4a063719b7234980793b67f17073f5325d5c71bdc71e61b22f762c8.jpg",
  "https://cdn.21st.dev/assets/mirror/8b/8b993f93ace0f90519c57fb690e783d4b34561d0876a3a4e23b71d2b8cda50c7.jpg",
  "https://cdn.21st.dev/assets/mirror/80/80dda9a133e84a153181a9381110c7550ae0e7da028db7c86859d64d077c2c51.jpg",
  "https://cdn.21st.dev/assets/mirror/c2/c2e770d647deb9f1ca62b49c8b868c70e8356d21d5d4b01cdbfff5679dd7718e.jpg",
]
export function ProductGalleryDemo() {
    return (
        <div className="container flex min-h-svh w-full items-center justify-center px-6 py-12">
      <ProductGallery
        className="gap-4 flex items-start justify-start gap-1"
        productImages={PRODUCT_IMAGES}
      >
        <ProductGalleryThumbsWrap className="flex flex-col items-start gap-1">
          {PRODUCT_IMAGES.map((imageUrl, index) => (
            <ProductGalleryThumb
              key={`${imageUrl}-${index}`}
              thumbImageUrl={imageUrl}
              index={index}
            />
          ))}
        </ProductGalleryThumbsWrap>
        <ProductGalleryPreviewImage>
          <Controls className=" flex flex-col gap-1" />
        </ProductGalleryPreviewImage>
      </ProductGallery>
    </div>
    )
}

Dependencies

More by YoucefBnm Bnm

View all
  • Animated Slideshow

    Animated Slideshow

    2.2K
  • Hero Gallery Scroll Animation

    Hero Gallery Scroll Animation

    1.5K
  • Animated Gallery

    Animated Gallery

    1.4K
  • Animated Video on Scroll

    Animated Video on Scroll

    1.4K
  • Animated Cards Stack

    Animated Cards Stack

    1.3K
  • Cards Stack

    Cards Stack

    1.1K
  • cta section with gallery

    cta section with gallery

    672
  • Hero Video

    Hero Video

    538

More in Galleries

View all
  • Thumbnail image viewer

    Thumbnail image viewer

    43
  • File Upload

    File Upload

    18
  • Editorial Collage Hero

    Editorial Collage Hero

    431
  • 3D Parallax Unfurling Gallery

    3D Parallax Unfurling Gallery

    981
  • Image Gallery

    Image Gallery

    123
  • Elastic Gallery

    Elastic Gallery

    908
  • Tilted Grid Hero

    Tilted Grid Hero

    1.5K
  • Hero Section 6

    Hero Section 6

    883