Introducing PrimeReact v11-alpha 🎉Discover Now
styledMedia

Gallery

Gallery is a component to display a collection of images in a gallery.

preview

Usage#

import { Gallery } from '@primereact/ui/gallery';
<Gallery.Root>
    <Gallery.Backdrop />
    <Gallery.Prev></Gallery.Prev>
    <Gallery.Next></Gallery.Next>
    <Gallery.Header>
        <Gallery.RotateLeft></Gallery.RotateLeft>
        <Gallery.RotateRight></Gallery.RotateRight>
        <Gallery.ZoomIn></Gallery.ZoomIn>
        <Gallery.ZoomOut></Gallery.ZoomOut>
        <Gallery.FlipX></Gallery.FlipX>
        <Gallery.FlipY></Gallery.FlipY>
        <Gallery.Download></Gallery.Download>
        <Gallery.FullScreen></Gallery.FullScreen>
    </Gallery.Header>
    <Gallery.Content>
        <Gallery.Item></Gallery.Item>
    </Gallery.Content>
    <Gallery.Footer>
        <Gallery.Thumbnail>
            <Gallery.ThumbnailContent>
                <Gallery.ThumbnailItem></Gallery.ThumbnailItem>
            </Gallery.ThumbnailContent>
        </Gallery.Thumbnail>
    </Gallery.Footer>
</Gallery.Root>

Examples#

Basic#

Displays a collection of images with a lightbox viewer.

basic-demo

Toolbar#

Add a Gallery.Header with action sub-components like RotateLeft, ZoomIn, Download, and FullScreen to expose image controls.

toolbar-demo

Thumbnails#

Add a Gallery.Footer with Gallery.Thumbnail to render a thumbnail strip for quick navigation.

thumbnails-demo

Grid#

image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
image
grid-demo

API#

Sub-Components#

See Primitive API for GalleryRoot, GalleryContent, GalleryItem, GalleryPrev, GalleryNext, GalleryHeader, GalleryFooter, GalleryBackdrop, GalleryThumbnail, GalleryThumbnailContent, GalleryThumbnailItem, and action component documentation.

Hooks#

See Headless API for useGallery hook documentation.

Accessibility#

See Gallery Primitive for WAI-ARIA compliance details and keyboard support.