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

@ethandev512/lightbox-gallery

v0.1.8

Published

A modern, customizable image lightbox web component built with FAST Element and Splide.js.

Readme

Lightbox Gallery

A modern, customizable image lightbox web component built with FAST Element and Splide.js.

Lightbox Gallery Demo

✨ Features

  • 🖼️ Full-screen lightbox with smooth animations
  • 🔍 Zoom & Pan - Zoom in/out and pan around images
  • ▶️ Autoplay slideshow with configurable interval
  • 📐 Horizontal/Vertical layouts - Toggle between layouts
  • 🎨 Themeable - CSS custom properties for easy styling
  • Accessible - ARIA labels and keyboard navigation
  • 📦 Zero config - Works out of the box
  • 🌐 Framework agnostic - Works with any framework or vanilla JS

🚀 Quick Start

Installation

# Using npm
npm install lightbox-gallery

# Using deno
deno add npm:lightbox-gallery

Using CDN

Import the pre-built ESM bundle directly in your HTML:

<script
  type="module"
  src="https://unpkg.com/@ethandev512/lightbox-gallery/dist/lightbox-gallery.js"
></script>

Note: The CDN build includes all dependencies bundled. Just import and use!

2. Add markup

Add images inside a container with slot="sources" and data-lightbox attribute:

<lightbox-gallery>
  <div slot="sources" data-lightbox>
    <img src="image1.jpg" alt="Description 1" />
    <img src="image2.jpg" alt="Description 2" />
    <img src="image3.jpg" alt="Description 3" />
  </div>
</lightbox-gallery>

3. Open programmatically

const gallery = document.querySelector("lightbox-gallery") as LightboxGallery;

// Open at specific index
gallery.openLightbox(0);

⚙️ Configuration

Attributes

| Attribute | Type | Default | Description | | --------- | --------- | ------- | ---------------------------- | | is-open | boolean | false | Controls lightbox visibility |

Properties (API)

Get a reference to the element to access these properties:

| Property | Type | Description | | ------------ | --------------- | ------------------------ | | isOpen | boolean | Whether lightbox is open | | isVertical | boolean | Vertical layout mode | | autoPlay | boolean | Autoplay slideshow state | | scale | number | Current zoom scale | | imgArray | ImgMetadata[] | Array of images |

Methods

| Method | Parameters | Description | | --------------------- | --------------- | -------------------------- | | openLightbox(index) | index: number | Open at specific index | | closeLightbox() | - | Close the lightbox | | toggleLayout() | - | Toggle horizontal/vertical | | handleZoomIn() | - | Zoom in | | handleZoomOut() | - | Zoom out | | resetZoom() | - | Reset zoom to 1x | | handleAutoPlay() | - | Toggle autoplay |

🎨 Theming

Customize the lightbox appearance using CSS custom properties:

lightbox-gallery {
  /* Backdrop */
  --lb-backdrop-color: rgba(0, 0, 0, 0.98);

  /* Toolbar */
  --lb-toolbar-bg: #1b1b1b78;
  --lb-toolbar-hover-bg: #3d3d3dda;
  --lb-toolbar-active-bg: #97969678;

  /* Thumbnails */
  --lb-thumbnail-opacity: 0.5;
  --lb-thumbnail-active-opacity: 1;
  --lb-thumbnail-border-radius: 8px;

  /* Navigation Arrows */
  --lb-arrow-bg: #b1b1b178;
  --lb-arrow-hover-bg: #3d3d3dda;
  --lb-arrow-active-bg: #c4c4c478;

  /* Z-Index */
  --lb-z-index: 1000000000;
}

📡 Events

The component emits custom events you can listen to:

const lightbox = document.querySelector("lightbox-gallery");

// When lightbox opens
lightbox.addEventListener("lightbox-open", (e: CustomEvent) => {
  console.log("Opened at index:", e.detail.index);
});

// When slide changes
lightbox.addEventListener("slide-change", (e: CustomEvent) => {
  console.log("Current slide:", e.detail.currentIndex);
});

| Event | Detail | Description | | ---------------- | ------------------------------------------------- | ----------------------------- | | lightbox-open | { index: number } | Fired when lightbox opens | | lightbox-close | void | Fired when lightbox closes | | slide-change | { previousIndex: number, currentIndex: number } | Fired when slide changes | | zoom-change | { scale: number } | Fired when zoom level changes |

⌨️ Keyboard Shortcuts

| Key | Action | | --------- | --------------------- | | / | Previous / Next image | | Escape | Close lightbox | | + / - | Zoom in / out | | Space | Toggle autoplay |

🛠️ Development

Requires Deno v2.0.0 or later.

# Start dev server
deno task dev

# Build for production
deno task build

# Preview production build
deno task preview

📄 License

MIT License

🙏 Credits