npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simple-lightbox-gallery

v1.0.0

Published

A modern, accessible, simple lightbox gallery with no dependencies

Readme

Simple Lightbox Gallery

npm version npm downloads commit size hits

A modern, accessible lightbox gallery with no dependencies. Perfect for creating responsive image galleries with features like zoom, fullscreen, slideshow, and touch support.

Features

  • 🖼️ Responsive grid layout
  • ⌨️ Full keyboard navigation
  • 📱 Touch gesture support
  • 🔍 Image zoom capability
  • ⛶ Fullscreen mode
  • ▶️ Slideshow option
  • 👆 Thumbnail navigation
  • 📝 Image captions
  • ♿ Fully accessible (ARIA support)
  • 🎨 Customizable themes
  • 📱 Mobile-friendly
  • 0️⃣ Zero dependencies

Installation

NPM

npm install simple-lightbox-gallery

CDN

<!-- Add to your HTML head -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-lightbox-gallery.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-lightbox-gallery.js"></script>

or

<!-- Add to your HTML head -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/simple-lightbox-gallery.css">
<script src="https://unpkg.com/[email protected]/dist/simple-lightbox-gallery.js"></script>

Usage

ES6 Module

import SimpleLightboxGallery from 'simple-lightbox-gallery';
import 'simple-lightbox-gallery/dist/simple-lightbox-gallery.css';

const gallery = new SimpleLightboxGallery({
    containerClass: 'gallery',
    showCaption: true
});

Script Tag

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-lightbox-gallery.css">
</head>
<body>
    <div class="gallery">
        <img src="image1.jpg" alt="Image 1">
        <img src="image2.jpg" alt="Image 2">
        <img src="image3.jpg" alt="Image 3">
    </div>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/simple-lightbox-gallery.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const gallery = new SimpleLightboxGallery({
                containerClass: 'gallery'
            });
        });
    </script>
</body>
</html>

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | containerClass | string | 'gallery' | Class name for the gallery container | | lightboxClass | string | 'lightbox' | Class name for the lightbox element | | animation | string | 'fade' | Animation type ('fade' or none) | | animationSpeed | number | 300 | Animation duration in milliseconds | | infinite | boolean | true | Enable infinite scrolling through images | | showThumbnails | boolean | false | Show thumbnail navigation panel | | showCaption | boolean | true | Show image captions | | captionPosition | string | 'bottom' | Caption position ('top' or 'bottom') | | overlayColor | string | 'rgba(0, 0, 0, 0.9)' | Background color of the lightbox | | zoomEnabled | boolean | true | Enable zoom functionality | | zoomLevel | number | 1.5 | Maximum zoom level | | fullscreen | boolean | true | Enable fullscreen mode | | swipeEnabled | boolean | true | Enable touch swipe navigation | | slideshow | boolean | false | Enable slideshow functionality | | slideshowSpeed | number | 3000 | Slideshow interval in milliseconds |

Accessibility Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | ariaLabels.gallery | string | 'Image gallery' | ARIA label for gallery | | ariaLabels.lightbox | string | 'Image lightbox' | ARIA label for lightbox | | ariaLabels.close | string | 'Close lightbox' | ARIA label for close button | | ariaLabels.next | string | 'Next image' | ARIA label for next button | | ariaLabels.prev | string | 'Previous image' | ARIA label for previous button | | ariaLabels.zoom | string | 'Toggle zoom' | ARIA label for zoom button | | ariaLabels.fullscreen | string | 'Toggle fullscreen' | ARIA label for fullscreen button | | ariaLabels.slideshow | string | 'Toggle slideshow' | ARIA label for slideshow button |

Example Usage

const gallery = new SimpleLightboxGallery({
    containerClass: 'my-gallery',
    showThumbnails: true,
    showCaption: true,
    animation: 'fade',
    zoomEnabled: true,
    zoomLevel: 2,
    fullscreen: true,
    slideshow: true,
    slideshowSpeed: 5000,
    ariaLabels: {
        gallery: 'My custom gallery',
        lightbox: 'Image viewer'
    }
});

API Methods

| Method | Description | |--------|-------------| | openLightbox(index) | Opens lightbox at specified image index | | closeLightbox() | Closes the lightbox | | prevImage() | Shows previous image | | nextImage() | Shows next image | | toggleZoom() | Toggles image zoom | | toggleFullscreen() | Toggles fullscreen mode | | toggleSlideshow() | Toggles slideshow | | destroy() | Removes event listeners and cleans up |

Keyboard Shortcuts

| Key | Action | |-----|--------| | | Previous image | | | Next image | | Esc | Close lightbox | | F | Toggle fullscreen | | Space | Play/pause slideshow | | Z | Toggle zoom |

Touch Gestures

| Gesture | Action | |---------|--------| | Swipe left | Next image | | Swipe right | Previous image |

Browser Compatibility

  • ✅ Chrome (latest)
  • ✅ Firefox (latest)
  • ✅ Safari (latest)
  • ✅ Edge (latest)
  • ✅ Opera (latest)
  • ✅ Chrome for Android
  • ✅ Safari iOS

CSS Customization

You can customize the appearance using CSS variables:

:root {
  --lightbox-overlay: rgba(0, 0, 0, 0.9);
  --lightbox-text: #ffffff;
  --control-bg: rgba(0, 0, 0, 0.5);
  --control-hover-bg: rgba(0, 0, 0, 0.8);
  --thumbnail-size: 60px;
  --caption-bg: rgba(0, 0, 0, 0.7);
}

Accessibility

  • Fully keyboard navigable
  • ARIA labels and roles
  • Screen reader announcements
  • Focus trap in modal
  • High contrast support
  • Reduced motion support

License

Commercial license

If you want to use this plugin to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Read more about the commercial license.

Open source license

If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use this project under the terms of the GPLv3.

Author

Raghu Chinnannan

Support

For support, please open an issue in the GitHub repository.