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

lightbox-fancy

v1.0.0

Published

A lightweight, customizable lightbox/fancybox implementation with thumbnails and zoom functionality

Downloads

1

Readme

Lightbox Fancy

A lightweight, customizable lightbox/fancybox implementation with thumbnails and zoom functionality. Built with vanilla JavaScript and CSS, no dependencies required.

Features

  • 🖼️ Responsive image gallery with lightbox effect
  • 🔍 Click-to-zoom functionality with pan support
  • 👆 Touch swipe support for mobile devices
  • ⌨️ Keyboard navigation (arrow keys and ESC)
  • 🎯 Thumbnail strip for quick navigation
  • 🎨 Smooth animations and transitions
  • 📱 Fully responsive design
  • ⚡ No dependencies

Installation

npm install lightbox-fancy

Usage

  1. Import the package in your JavaScript:
import LightboxFancy from 'lightbox-fancy';
import 'lightbox-fancy/dist/lightbox-fancy.css';
  1. Add the lightbox trigger class to your images:
<div class="gallery">
    <img src="thumbnail1.jpg" 
         alt="Image Caption" 
         class="lightbox-trigger" 
         data-lightbox-src="full-size1.jpg">
    <img src="thumbnail2.jpg" 
         alt="Another Caption" 
         class="lightbox-trigger" 
         data-lightbox-src="full-size2.jpg">
</div>
  1. Initialize the lightbox:
document.addEventListener('DOMContentLoaded', () => {
    const myLightbox = new LightboxFancy();
});

Customization

You can customize the lightbox by passing options when initializing:

const myLightbox = new LightboxFancy({
    selector: '.custom-trigger', // Custom selector for trigger elements
    srcAttribute: 'data-custom-src', // Custom attribute for full-size image source
    captionAttribute: 'data-caption', // Custom attribute for caption text
    enableKeyboard: true, // Enable/disable keyboard navigation
    enableSwipe: true, // Enable/disable swipe support
    animationSpeed: 500, // Animation speed in milliseconds
    showThumbnails: true // Enable/disable thumbnail strip
});

API Reference

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | selector | string | '.lightbox-trigger' | CSS selector for trigger elements | | srcAttribute | string | 'data-lightbox-src' | Attribute for full-size image URL | | captionAttribute | string | 'alt' | Attribute for image caption | | enableKeyboard | boolean | true | Enable keyboard navigation | | enableSwipe | boolean | true | Enable touch swipe support | | animationSpeed | number | 300 | Animation duration in milliseconds | | showThumbnails | boolean | true | Show thumbnail strip |

Methods

  • open(trigger): Open the lightbox with the specified trigger element
  • close(): Close the lightbox
  • navigate(direction): Navigate to the next/previous image ('prev' or 'next')
  • toggleMagnification(): Toggle image zoom

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Opera (latest)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.