Free
Pro

Product Gallery

A premium, responsive product gallery component featuring thumbnail navigation, hover-to-zoom capabilities, and video support.

Pro

Product Gallery — part of Base UI Pro

Unlock it plus 89 pro blocks, widgets & layouts — $99 one-time. Lifetime updates, 14-day money-back guarantee.

Unlock Pro

Thumbnails on Left

HTML

Thumbnails on Bottom

HTML

Thumbnails on Right

HTML

Thumbnails on Top

HTML

How to Use

The Product Gallery component provides a robust layout for showcasing product imagery. Drop in a <base-product-gallery> element and configure your aspect ratio padding, thumbnail alignment, and zoom interactions natively.

HTML

Define your gallery footprint array in TypeScript mapping the layout payload:

TypeScript

Installation

Run the following command to add this component to your project:

bash

npx base-ui-cli add product-gallery

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.

bash

npx -y base-ui-mcp

Base UI provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// Install: npx base-ui-cli add product-gallery
// Paths are relative to aliases.components (default: src/app/components)
import { GalleryItem, ProductGalleryComponent } from './product-gallery/product-gallery.component';

@Component({
  selector: 'app-your-component',
  imports: [
    ProductGalleryComponent
  ],
  template: `...`
})
export class YourComponent {}

API for product-gallery — generated from JSDoc in the library source.

API reference for product-gallery
APIMemberTypeDefaultDescription
GalleryItemidstring | numberOptional unique identifier for the item.
GalleryItemsrcstringThe source URL of the main image or video.
GalleryItemthumbSrcstringThe source URL of the thumbnail image. Defaults to `src` if not provided.
GalleryItemaltstringAlternative text for accessibility.
GalleryItemtype'image' | 'video'Media type, either 'image' or 'video'. Defaults to 'image'.
base-product-galleryclassstring''Additional CSS classes to merge into the host element.
base-product-gallerygalleryLabelunknown'Product gallery'Accessible label for the product gallery carousel region.
base-product-galleryitemsGalleryItem[][]The array of media items to display in the gallery.
base-product-gallerythumbnailsPosition'left' | 'right' | 'top' | 'bottom''left'Position of the thumbnails strip relative to the main viewer. Defaults to 'left'.
base-product-galleryshowArrowsbooleantrueWhether to show previous/next navigation arrows on the main viewer.
base-product-galleryobjectFit'cover' | 'contain''cover'CSS object-fit rule for the main image ('cover' or 'contain').
base-product-galleryzoomOnClickbooleantrueEnables an interactive magnifying zoom effect when clicking the main image.
base-product-galleryaspectRatiostring'16/9'Aspect ratio constraint for the main viewer (e.g., '16/9' or '1/1').
base-product-gallerymainViewWidthstring'100%'Width of the main view container. Defaults to '100%'.
base-product-gallerymainViewHeightstring'auto'Height of the main view container. Defaults to 'auto'.
base-product-gallery(indexChange)numberEmitted whenever the active selected item changes.