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

lc-lightbox

v0.9.3

Published

A lightbox component using the dialog HTML element

Readme

🥕 Low-cal Lightbox

A simple lightbox for a single image. To use, wrap your image tag with <lc-lightbox></lc-lightbox> tags. Now you can click the image to get a lightbox view of that image.

The thumbnail is keyboard accessible: it can be focused with Tab and opened with Enter or Space, and Esc closes the lightbox.

With no attributes, the image src will be used for the lightbox image.

<lc-lightbox>
  <img src="somewhere/over/the/rainbow.jpg">
</lc-lightbox>

Attributes

Optional attributes are listed below. They can also be changed at runtime (e.g. el.setAttribute('disabled', '')) and the lightbox will update.

src

An alternative image to use for the lightbox image. Mostly so a larger image can be used for the lightbox images.

min-width

The min width the lightbox will work. This is so it is disabled for mobile where this isn't necessary.

Note this is checked when the page loads (and when an attribute changes), not when the window is resized, so if the window is resized the behavior may not be as expected.

The default is 640px.

disabled

If the attribute is present, with or without a value (e.g. <lc-lightbox disabled>), the lc-lightbox will be disabled.

debug="templates"

This will output rendered templates.

<lc-lightbox src="a/bigger/image.jpg" min-width="300" disabled="1" debug="templates">
  <img src="somewhere/over/the/rainbow.jpg">
</lc-lightbox>

CSS custom properties

--image-border-width sets the white border around the lightbox image (default 1rem). It can be set on the lc-lightbox tag or on any ancestor, e.g. :root { --image-border-width: 0; }.

Custom template

If further customization needs to be done, add a <template> to the document and give it an id of low-cal-template. This will override the default one. It should be added before the script tag.

You can get the default template by adding debug="templates" to the lc-lightbox tag. This will output the rendered templates to the console, which you can copy and paste into the html file.

Data attribute

When the lightbox is shown, the tag will have a data-lc-open="open" attribute. For example, this can be used in css to add an overflow: clip to to the body to prevent scrolling.

Dev

  • npm run build
  • npm pack lc-lightbox/ – The trailing slash is required.
  • npm login
  • npm publish lc-lightbox

Images from https://unsplash.com