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

overlay-image-gallery

v2.0.0

Published

Overlay Image Gallery is a lightweight, animated React gallery: mosaic grids, a lightbox with zoom, swipe, keyboard navigation, fullscreen and more.

Downloads

408

Readme

Overlay Image Gallery

npm version Download Count Bundle size

A lightweight, animated React image gallery with a full-featured lightbox — zero runtime dependencies beyond React.

Highlights

  • Three grid variants — mosaic, featured, uniform — with staggered entrance animations, hover shine and caption reveals.
  • Cinematic lightbox — blurred veil, spring-eased transitions, portal rendering, exit animations.
  • Fluid gestures — 1:1 drag-to-swipe with velocity snapping, swipe-down-to-dismiss, edge resistance.
  • Zoom — double-click/double-tap, pinch on touch, scroll-wheel zoom, pan with clamping.
  • Keyboard accessible — ←/→ navigate, Esc closes, Home/End jump, focus is trapped and restored.
  • Thumbnails — auto-scrolling strip with active indicator.
  • Fullscreen & download buttons, animated autoplay progress bar, image captions.
  • Lightweight — no animation or slider libraries; CSS transforms and pointer events only.
  • Theming — every color, radius and easing is a --oig-* CSS custom property.
  • Respectful — prefers-reduced-motion supported, lazy loading, SSR-safe.

Live Demo

Installation

npm install overlay-image-gallery
Or
yarn add overlay-image-gallery

Usage

import { OverlayGallery } from "overlay-image-gallery";

const App = () => {
  const images = [
    { src: "https://example.com/beach.jpg", alt: "A beach", caption: "Beach day", category: "Nature" },
    { src: "https://example.com/forest.jpg", alt: "A forest", caption: "Pine hollow", category: "Nature" },
    { src: "https://example.com/tower.jpg", alt: "A skyline", caption: "Downtown", category: "City" },
    "https://example.com/road.jpg", // plain URLs work too
  ];

  return (
    <OverlayGallery
      images={images}
      variant="mosaic"
      fitMode="cover"
      title="Travel journal"
      subtitle="Two weeks on the road, in fifteen frames."
      showFilters
    />
  );
};

export default App;

The component ships zero chrome: a header and category filter bar are rendered only when you pass title/subtitle/showFilters. Everything on screen is a prop.

Props

| Prop | Type | Default | Description | | ------------------- | ------------------------- | ----------- | ----------------------------------------------------------------- | | images | Array<string \| object> | — | (Required) Image URLs or { src, alt, caption, category } objects. | | variant | "mosaic" \| "featured" \| "uniform" | "mosaic" | Grid layout style. | | fitMode | "contain" \| "cover" \| "fill" \| "none" \| "scale-down" | "cover" | CSS object-fit for grid tiles. | | maxTiles | Number | 10 | Maximum tiles shown before a +N overlay appears. | | fullScreen | Boolean | false | Stretch the grid to fill its container. | | width / height | Number (px) | — | Fixed grid size when not full-screen. | | title | ReactNode | — | Header heading above the grid; renders only when provided. | | subtitle | ReactNode | — | Header line under the title; renders only when provided. | | actions | ReactNode | — | Slot beside the header (buttons, links); renders only when provided. | | showFilters | Boolean | false | Show category filter chips (needs ≥ 2 distinct category values). | | defaultCategory | String | "all" | Category selected initially. | | allLabel | String | "All" | Label of the "show everything" chip (for i18n). | | showThumbnails | Boolean | true | Show the thumbnail strip inside the lightbox. | | zoom | Boolean | true | Enable zoom gestures and the zoom button. | | loop | Boolean | true | Wrap navigation at both ends. | | autoplay | Boolean | false | Advance automatically with a progress bar. | | autoplayInterval | Number (ms) | 4000 | Time per slide when autoplay is on. | | className | String | — | Extra class on the root element. | | onOpen | (index) => void | — | Fired when the lightbox opens. | | onClose | () => void | — | Fired when the lightbox closes. | | onIndexChange | (index) => void | — | Fired when the active image changes. | | onFilterChange | (category) => void | — | Fired when a category filter is selected. |

Theming

Override the CSS custom properties on any ancestor (or the root .oig element):

.my-gallery {
  --oig-accent: #e0653a;
  --oig-radius: 20px;
  --oig-gap: 12px;
}

| Token | Purpose | | ------------------ | -------------------------------------- | | --oig-accent | Accent color (focus rings, progress) | | --oig-veil | Lightbox backdrop color | | --oig-radius | Tile and image corner radius | | --oig-gap | Grid gap | | --oig-ease | Signature easing curve | | --oig-shadow | Image shadow inside the lightbox |

Accessibility

The gallery ships with WCAG-minded defaults: tiles are real buttons, the lightbox is a labelled role="dialog" with aria-modal, focus is trapped while open and restored on close, the counter is announced via aria-live, and every animation collapses under prefers-reduced-motion: reduce.

Running Locally

git clone https://github.com/b-owl/overlay-image-gallery.git
cd overlay-image-gallery
npm install
npm run dev

Then open localhost:3000 in a browser.

Contributing

We welcome contributions! When making a pull request, please focus on a specific issue. Avoid combining multiple changes in one PR. Describe your feature or implementation clearly. For major changes or if you're unsure about the usefulness of a change, please open an issue first to discuss it.

  • Follow eslint provided
  • Write clean code

License

This project is licensed under the MIT License.