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

@hoangyell/gallery

v1.0.6

Published

Astro image gallery with lightbox, pyramid multi-row layout, and accessible controls.

Readme

@hoangyell/gallery

Astro image gallery component with lightbox, pyramid multi-row layout, and accessible controls.

Live demo → gallery.hoangyell.com

Features

  • Pyramid layout — distribute images across rows with rows prop
  • Two fit modescover (default, uniform photo grid) or contain (natural aspect, for diagrams and tall portraits)
  • Lightbox — click to open, keyboard arrows, swipe, ESC to close
  • Corner rounding — only the four outer corners of each group are rounded
  • Hover zoom — image scales inside its cell without changing layout
  • Accessible — focus management, ARIA labels, safe-area controls, reduced-motion support
  • Zero config — plain CSS, no Tailwind required in the host project

Installation

pnpm add @hoangyell/gallery

Usage

---
import { Gallery } from "@hoangyell/gallery";

const photos = [
  "/img/one.jpg",
  "/img/two.jpg",
  "/img/three.jpg",
];
---

<Gallery items={photos} rows={2} />

In MDX

import { Gallery } from "@hoangyell/gallery";

<Gallery
  items={[
    "https://example.com/a.webp",
    "https://example.com/b.webp",
    { src: "https://example.com/c.webp", alt: "Temple gate", fit: "cover" },
  ]}
  rows={3}
/>

Props

| Prop | Type | Default | Description | |---|---|---|---| | items | (string \| { src, alt?, fit? })[] | [] | Image URLs or objects | | alts | string[] | — | Alt text paired with string URLs | | rows | number | auto (~3 per row) | Number of visual rows | | orientation | "landscape" \| "portrait" | "landscape" | Item aspect ratio hint | | scale | number | 1 | Gallery width scale (0–1) | | fit | ObjectFit | "cover" | Default CSS object-fit — see Fit modes below | | class | string | — | Extra wrapper class |

Fit modes

The fit prop controls both the image's object-fit and the container's aspect ratio. Pick the right one for your content:

| Mode | What you get | When to use | |---|---|---| | "cover" (default) | Uniform 4:3 grid (1:1 on mobile). Images are cropped to fill. | Photo galleries — travel, products, faces. The Pinterest aesthetic. | | "contain" | Container hugs each image's natural aspect ratio. No cropping. | Diagrams, charts, screenshots, comics, tall portraits. |

Set it at the gallery level:

<Gallery items={["/diagram.png"]} rows={1} fit="contain" />

Or per-item (mix and match in the same gallery):

<Gallery
  items={[
    "/cover-photo.jpg",
    { src: "/architecture-diagram.png", fit: "contain" },
  ]}
/>

Dark mode

The component auto-themes via three mechanisms (last one wins):

  1. prefers-color-scheme: dark — OS preference (default).
  2. <html class="dark"> or <html data-theme="dark"> — Tailwind-style class toggle.
  3. <html class="light"> or <html data-theme="light"> — explicit light theme override.

This means it Just Works™ with manual theme toggles and OS preference.

Customization

Override CSS custom properties on .hy-gallery:

.hy-gallery {
  --hy-gallery-gap: 6px;
  --hy-gallery-radius: 12px;
  --hy-gallery-accent: #e11d48;
}

| Variable | Default | Purpose | |---|---|---| | --hy-gallery-gap | 4px | Grid gap between cells | | --hy-gallery-radius | 1rem | Outer corner radius | | --hy-gallery-bg | #f8fafc | Item placeholder background | | --hy-gallery-overlay-bg | rgba(255,255,255,0.7) | Lightbox backdrop | | --hy-gallery-accent | #2563eb | Focus ring and hover accent |

License

MIT