lightGallery v3

Gallery that feels native

An image and video lightbox gallery for the modern web. Available natively for JavaScript, React, Vue and Angular.

The gallery behind the world's biggest brands.

Frameworks

Native, not wrapped

Real components for React, Vue and Angular, and plain JavaScript, each written for its framework, with the same features in every one of them.

Plain JavaScript, no dependencies. Point it at your markup or an array of items, from npm or a CDN.

npm install lightgallery
import lightGallery from 'lightgallery';
import lgThumbnail from 'lightgallery/plugins/thumbnail';
import lgZoom from 'lightgallery/plugins/zoom';
import 'lightgallery/css/lightgallery-bundle.css';

lightGallery(document.getElementById('gallery'), {
    plugins: [lgZoom, lgThumbnail],
});

A real React component: props, children, refs and callbacks, all typed. Your state stays in React.

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

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

v-model for the open state, slots for captions and controls, Teleport for the overlay.

npm install @lightgallery/vue lightgallery
<script setup>
import { LightGallery, LgItem } from '@lightgallery/vue';
import Thumbnail from '@lightgallery/vue/plugins/thumbnail';
import Zoom from '@lightgallery/vue/plugins/zoom';
</script>

<template>
    <LightGallery :plugins="[Zoom, Thumbnail]">
        <LgItem v-for="item of items" :key="item.src" :item="item">
            <img :src="item.thumb" :alt="item.alt" />
        </LgItem>
    </LightGallery>
</template>

Standalone components, signals, zoneless change detection and a CDK overlay, nothing bolted on.

npm install @lightgallery/angular @angular/cdk lightgallery
<lg-gallery [features]="[withZoom(), withThumbnail()]">
    @for (item of items; track item.src) {
        <a [lgGalleryItem]="item">
            <img [src]="item.thumb" [alt]="item.alt" />
        </a>
    }
</lg-gallery>
Features

Everything a gallery needs

Each of these has a page with a live demo and the settings behind it.

New in v3

Thumbnails

Animated or static strips, fetched automatically for YouTube and Vimeo, draggable on every device.

Zoom

Pinch and double-tap to zoom. Slides open from the thumbnail's position and close back to it.

Video New in v3

YouTube, Vimeo, Wistia and HTML5 video, with autoplay-on-slide and posters. Facades load the player only when someone presses play.

Justified layout New in v3

Row-justified trigger grids from one plugin, no layout library in front of the lightbox.

Virtualization New in v3

Thousand-slide galleries keep a few dozen nodes in the DOM; slides and thumbnails mount as they come into view.

Thumbnail scrubbing New in v3

Drag the thumbnail strip and the gallery follows instantly, all the way through the release glide.

Custom icons New in v3

Every control icon is an inline SVG you can replace by name, bring your own set without touching CSS.

Localization & RTL New in v3

Every string is a setting, and the gallery mirrors for right-to-left pages, navigation, swipe direction and chrome.

Accessibility

Keyboard navigation, focus management and screen-reader announcements out of the box.

Responsive loading

Size ladders and srcset for the lightbox image, so phones never download the desktop original.

Sharing

The device's native share sheet where it exists, social links where it doesn't.

Deep links

A URL for every slide, with browser back and forward, on hash or history drivers.

Dynamic mode

Open a gallery from an array of items, no trigger markup required.

Live updates

Add, edit and remove slides while the gallery is open.

Transitions

Twenty-plus slide transitions, hardware accelerated, plus your own easing.

Captions

HTML captions per slide, from markup or data, with animated and relative-position variants.

Comments

A per-slide comment panel with Facebook and Disqus adapters, or your own widget.

Rotate & flip

Rotate and flip any image, with hooks to persist the result.

Autoplay & fullscreen

Slideshow with a progress bar that pauses on interaction, and native fullscreen from the toolbar.

Pagers

Minimal dot navigation instead of a strip, with thumbnails on hover.

Mixed content

Photos, videos and iframes in one gallery, maps and PDFs included, each slide sized for what it holds.

Gestures and motion

Physics, not transitions.

Every release is a spring seeded with the user’s velocity. Flings land where they should, edges push back, nothing snaps.

Velocity carries over

The last 100 ms of your gesture seed the release spring. Motion continues from the speed you let go at, it never restarts from zero.

Momentum knows where it lands

A fling projects its landing point with the same deceleration curve native scroll views use, then settles there.

Edges push back

Slides, the thumbnail strip and zoom panning resist at the boundary with friction instead of stopping dead, and return with a single soft bounce.

Zoom stays under your fingers

Pinch anchors to the point between your fingertips, pan included, so what you zoom into is what you look at.

Interruptible everywhere

Catch a slide mid-spring and it hands you its live position and velocity; the next release starts a new spring from exactly there.

Identical on every stack

JavaScript, React, Vue and Angular share the same feel, not a port of it, so nothing is tuned differently in yours.

Bundle size

Modular by design

Every feature outside the core is a plugin with its own entry point. Import the two you use and the rest never reach your bundle. Sizes are from this site’s build, minified and gzipped.

import lightGallery from 'lightgallery';
import lgThumbnail from 'lightgallery/plugins/thumbnail';
import lgZoom from 'lightgallery/plugins/zoom';

// Two plugins, two imports, nothing else ships.
lightGallery(el, { plugins: [lgZoom, lgThumbnail] });
Two plugins, two imports. Everything else stays out of the bundle.
Mobile and accessibility

Optimized for everyone

Most gallery views happen on a phone, and some happen without a mouse or a screen. The defaults assume both.

On a phone

  • Separate mobile settings. A second settings object applies on small screens, so the toolbar can be lean where space is tight.
  • CSS does the sizing. Images and videos fit by stylesheet rules, not per-slide measurement, so rotation and resize cost nothing.
  • Phone-sized files. Responsive image ladders and srcset mean a phone never downloads the desktop original.
  • Video on a budget. Facades keep cellular data for the videos people actually press play on.
  • The native share sheet where the browser has one, social links where it doesn’t.
Esc
Close the gallery
← →
Previous and next slide, following the reading direction on RTL pages
↑ ↓
Show and hide the thumbnail strip when toggling is enabled
Tab
Cycles through the gallery’s controls and never escapes to the page behind

With a keyboard or a screen reader

  • A dialog, not a div. Focus moves into the gallery on open and returns to the trigger that opened it on close.
  • Every slide is announced once, through a polite live region, from a template string you can localize.
  • Labelled controls. Every button carries a label from the strings settings, translate them and the labels follow.
  • Reduced motion is honored for transitions and the opening animation.
FAQ

Questions people ask first

Is it free?

Yes. lightGallery is free and open source under the GPLv3, for personal and commercial projects alike, as long as your project is distributed under GPLv3-compatible terms. If you keep your source proprietary, a commercial license covers it: same code, no feature gates, one-time payment.

Does it need jQuery?

No. lightGallery has no dependencies. The only jQuery on this site is for the two demos that integrate third-party jQuery carousels.

Which frameworks are supported?

Plain JavaScript and TypeScript, plus native packages for React, Vue and Angular, the same features in all of them. For anything else, the gallery’s core is available on its own as @lightgallery/headless.

Which browsers?

Current evergreen browsers and iOS Safari. There are no polyfills and no legacy builds.

I’m on version 2. What changes?

Version 3 is a complete rewrite with smoother touch gestures, faster loading, accessibility and new features like justified layouts, while the vanilla API stays unchanged. The framework wrappers are replaced by native packages and the icon font is gone. The release post has what’s new, and the migration guide lists every step.

Are TypeScript types included?

Yes, every package ships its own types; settings, events and plugin options are fully typed.

Get started

Start with your stack

In production at thousands of teams since 2014, from solo developers to the world’s biggest brands. Live in minutes.

Your team
JavaScriptGet started →ReactGet started →VueGet started →AngularGet started →

or browse the demos first.