Every React project I’ve worked on eventually needs a gallery, and every time the same thing happens. Someone searches npm, finds forty packages called some variation of “react gallery”, and picks the the one with the most stars. Half of those are carousels, not lightboxes. A few are wrappers around a DOM library that fight React for control of the page. And a couple are genuinely great, as long as you want exactly what they do.

So I went through the ones people actually install and asked the questions that end up deciding it in practice. Is it a real React component or a wrapper? Does it do thumbnails and video, or just images? How does it feel on a phone? Can I make it look like part of my site instead of a plugin? Will it render on the server in Next.js without a dynamic() wrapper? And what does the license let you do? The numbers come straight from npm and GitHub, and the opinions are mine.

The seven at a glance

Feature lightGallery React Image Gallery PhotoSwipe React Photo View Swiper Keen Slider React Slick
Setup
Native React component Yes Yes Init in an effect Partly: Yes Wraps the core Partly: Hook Yes: Yes
Server rendering Yes Yes Triggers only Partly: Yes Yes Yes Yes
Lightbox overlay Yes Fullscreen mode Partly: Yes Yes No No No
Media
Thumbnail strip Yes Yes No No Yes Second slider Partly: Second slider Partly:
Video slides YouTube, Vimeo, Wistia, HTML5 Yes: Partly HTML5 plugin Partly: Partly Partly Partly Partly
Lazy video embeds Yes No No No No No No
Video thumbnails fetched for you Yes No No No No No No
Iframe slides, maps and PDFs Yes Partly Partly Partly Partly Partly Partly
Responsive images, srcset and picture Yes Yes Yes Partly Partly Partly Partly
Captions Yes Yes Plugin Partly: Partly No No No
Interaction
Pinch and double-tap zoom Yes No Yes Yes Yes No No
Swipe or pinch to close Yes No Yes Yes No No No
Opens from the thumbnail Yes No Yes Yes No No No
Thumbnail scrubbing Yes No No No No No No
Fullscreen Yes Yes Partly Partly No No No
Keyboard navigation Yes Yes Yes Yes Yes No Yes
Screen reader support Dialog, announcements Yes: Partly Partly Partly Yes No Partly
Reduced motion Yes No Yes No No No No
Layout and scale
Justified grid Yes No No No No No No
Virtualization Yes Partly Yes Yes Yes Partly Partly
Right-to-left Yes Yes No No Yes Yes Yes
Custom icons Yes Yes Yes Partly Partly Partly Yes
Links and sharing
Deep links, back and forward Yes No No No Yes No No
Native share sheet Yes No No No No No No
Project
Core size, gzipped 19 KB 10 KB 17 KB 8 KB 20 KB 6 KB 15 KB and CSS
Last release Oct 2026 Feb 2026 May 2024 Jan 2025 Sep 2026 Jul 2023 Aug 2025
License GPLv3 or commercial MIT MIT Apache-2.0 MIT MIT MIT
Yes Partly No Partly means it takes your own code, a plugin or a paid tier. Server rendering means the component renders on the server in Next.js without a client-only wrapper, which Keen Slider and React Slick do without documenting it. Core size is the main entry minified and gzipped, from Bundlephobia for everything but lightGallery. Last release is the latest npm version's publish date.

lightGallery

lightGallery, a native React image gallery and lightbox

I’ll start with the one I know best. The thing to understand about lightGallery is that @lightgallery/react is a real component now, not a wrapper. React renders the grid and the lightbox, the same core drives the Vue and Angular packages, and the grid server-renders as plain markup, so Next.js is happy without any dynamic() tricks. The lightbox portal only mounts after hydration.

Everything that isn’t the core lightbox is a plugin with its own import. That covers thumbnails, zoom, video, autoplay, fullscreen, share, rotate, hash URLs, a justified grid, and so on. The core is about 19 KB gzipped, zoom adds about 7 KB, and whatever you don’t import never touches your bundle. The vanilla package alone sees around 100,000 npm downloads a week.

On a phone it behaves like a photos app. Swipe between slides, pinch or double tap to zoom, drag or pinch to close, and every fling keeps the speed you let go at and settles in a spring instead of snapping to a stop. Edges resist with friction, and reduced-motion turns all of it off. It’s the best touch experience on this list, and I’d say that even if it weren’t ours.

It also looks finished out of the box, which matters more than it sounds for something that frames other people’s photos. The chrome is restrained, the toolbar stays on one row and folds its least important buttons into a menu when space runs out, and every icon is an inline SVG that takes the button’s color, so recoloring the whole set is one CSS rule. Past that, a render slot swaps any icon by name, there are twenty-odd slide transitions plus your own easing, captions take any HTML, and a className on the gallery scopes your own styles to it. Restyling is still CSS, same as everywhere, but the defaults mean you rarely need much of it.

import { LightGallery, LightGalleryItem } from '@lightgallery/react';
import Thumbnail from '@lightgallery/react/plugins/thumbnail';
import Zoom from '@lightgallery/react/plugins/zoom';

const items = [
    { src: 'img/1-1600.jpg', thumb: 'img/1-240.jpg', alt: 'Mountains', lgSize: '1600-1067' },
    { src: 'img/2-1600.jpg', thumb: 'img/2-240.jpg', alt: 'Forest path', lgSize: '1600-2400' },
];

export function Gallery() {
    return (
        <LightGallery plugins={[Thumbnail, Zoom]}>
            {items.map((item) => (
                <LightGalleryItem key={item.src} item={item} href={item.src}>
                    <img src={item.thumb} alt={item.alt} />
                </LightGalleryItem>
            ))}
        </LightGallery>
    );
}

Pick it if you want thumbnails, video, zoom and a proper touch experience from one component, if your team also ships Vue or Angular, or if you’re on Next.js and care about the grid being in the HTML.

The honest downside is the license. It’s free under the GPLv3, which is fine for open source, but a proprietary codebase needs a one-time commercial license. You also need the full-size image dimensions (lgSize) if you want the open-from-thumbnail animation, which can be a nuisance with images from an API that doesn’t give you sizes.

React Image Gallery

React Image Gallery is the one I reach for when a client says “like a product page”, meaning an inline carousel with a row of thumbnails underneath and a fullscreen button. Swipe, keyboard, RTL and autoplay are all there, and any slide can be a custom render, which is how you get video in.

What it isn’t is a lightbox. Fullscreen mode is the carousel scaled up, not a seperate overlay, and there’s no pinch or double-tap zoom. If you need either, you’ll be adding a second library. Styling past the default theme also means overriding it’s CSS, which is fine for a few tweaks and tedious for a redesign.

PhotoSwipe

PhotoSwipe

PhotoSwipe has the best touch feel of the image-only libraries here. Pinch zoom, double tap and the drag-down-to-close gesture all feel like a native photos app. It’s framework-free, so from React you create it in a useEffect and point it at your own grid markup. There’s no official component, just the documented pattern.

That’s also the catch. Because it touches the DOM directly, it has to be initialised on the client only, and because it’s images-first, video and a thumbnail strip are both things you add yourself. It also wants the full-size width and height of every image up front. If you only ever show photos and want good gestures in a small package, none of that will bother you.

React Photo View

React Photo View

React Photo View is a small native viewer, about 7 KB gzipped, with pinch zoom, drag-and-pan that bounces at the edges, keyboard navigation and server rendering. You wrap the page’s images in PhotoProvider and PhotoView and you’re done. A custom node, such as a video element, can be a slide too.

I’d use it for images in articles or feeds where you don’t want a whole gallery system. There’s no thumbnail strip and no video providers, and features like fullscreen or rotation are things you build from custom nodes rather than switch on.

Swiper

Swiper

Swiper is the most capable carousel engine around, and its React components sit on top of it. Thumbnails come from the Thumbs module, pinch zoom from the Zoom module, and there are modules for pagination, navigation, parallax and virtual slides. If your slider has unusual behaviour, Swiper can probably do it.

It’s a carousel, though, not a lightbox, so the full-screen view is yours to add, and it’s heavy for a simple gallery. One more thing worth knowing is that the Swiper team now recommends their web components over the React components for new work.

Keen Slider

Keen Slider

Keen Slider is the headless option, at about 6 KB gzipped with no styles at all and a useKeenSlider hook that gives you the slider state and leaves every pixel of markup to you. Thumbnails are a second slider linked to the first, which the docs show how to do.

If you’re designing a carousel from scratch and want nothing imposed on you, it’s lovely. If you want a lightbox, zoom or a thumbnail strip out of the box, it’s the wrong tool, because each of those is your own code.

React Slick

React Slick

React Slick is the React port of the Slick carousel, which means responsive breakpoints, autoplay, lazy loading, infinite loop and the asNavFor trick that links two sliders into a thumbnail row. It has been around so long that nearly every layout question already has a Stack Overflow answer.

It also depends on the jQuery-era CSS from slick-carousel, has no lightbox or zoom, and gets fewer updates than anything else here. I’d only pick it for a team already on Slick. If that’s you, the Slick slider with lightbox demo shows how to pair it with a lightbox for the full-screen view.

So which one?

  • lightGallery if you want one component that does grid, lightbox, thumbnails, video and zoom.
  • React Image Gallery if you want an inline slider with thumbnails and nothing modal, or Swiper if you need more control.
  • PhotoSwipe or React Photo View if you only show images and want good gestures in the smallest package.
  • Keen Slider if you want to design the carousel yourself.
  • React Slick if you’re already on Slick, plus a lightbox for full-screen.

If lightGallery is the pick, the React image gallery demo, the Next.js guide and the React package docs are where I’d start.