Gathering detailed insights and metrics for yet-another-react-lightbox
Gathering detailed insights and metrics for yet-another-react-lightbox
Gathering detailed insights and metrics for yet-another-react-lightbox
Gathering detailed insights and metrics for yet-another-react-lightbox
npm install yet-another-react-lightbox
Typescript
Module System
Min. Node Version
Node Version
NPM Version
94.7
Supply Chain
94.5
Quality
90.1
Maintenance
100
Vulnerability
100
License
TypeScript (91.53%)
SCSS (4.83%)
JavaScript (2.78%)
CSS (0.62%)
HTML (0.25%)
Total Downloads
9,401,703
Last Day
6,353
Last Week
153,754
Last Month
613,483
Last Year
5,960,635
MIT License
1,028 Stars
459 Commits
43 Forks
4 Watchers
1 Branches
9 Contributors
Updated on Jun 23, 2025
Minified
Minified + Gzipped
Latest Version
3.23.2
Package Id
yet-another-react-lightbox@3.23.2
Unpacked Size
221.85 kB
Size
48.21 kB
File Count
37
NPM Version
10.9.2
Node Version
22.15.0
Published on
May 18, 2025
Cumulative downloads
Total Downloads
Last Day
9.3%
6,353
Compared to previous day
Last Week
0%
153,754
Compared to previous week
Last Month
5.5%
613,483
Compared to previous month
Last Year
99.3%
5,960,635
Compared to previous year
4
Modern React lightbox component. Performant, easy to use, customizable and extendable.
https://yet-another-react-lightbox.com/documentation
https://yet-another-react-lightbox.com/examples
https://github.com/igordanchenko/yet-another-react-lightbox/releases
1npm install yet-another-react-lightbox
1import * as React from "react"; 2import Lightbox from "yet-another-react-lightbox"; 3import "yet-another-react-lightbox/styles.css"; 4 5export default function App() { 6 const [open, setOpen] = React.useState(false); 7 8 return ( 9 <> 10 <button type="button" onClick={() => setOpen(true)}> 11 Open Lightbox 12 </button> 13 14 <Lightbox 15 open={open} 16 close={() => setOpen(false)} 17 slides={[ 18 { src: "/image1.jpg" }, 19 { src: "/image2.jpg" }, 20 { src: "/image3.jpg" }, 21 ]} 22 /> 23 </> 24 ); 25}
Unlike many other lightbox libraries, Yet Another React Lightbox is not limited
to just two images per slide ("thumbnail" and "original" / "full size").
Instead, we favor responsive images with automatic resolution switching and
recommend you provide multiple files of different resolutions for each image
slide. Yet Another React Lightbox automatically populates srcset
/ sizes
attributes and lets the user's browser decide which image is more appropriate
for its viewport size.
1import * as React from "react"; 2import Lightbox from "yet-another-react-lightbox"; 3import "yet-another-react-lightbox/styles.css"; 4 5export default function App() { 6 const [open, setOpen] = React.useState(false); 7 8 return ( 9 <> 10 <button type="button" onClick={() => setOpen(true)}> 11 Open Lightbox 12 </button> 13 14 <Lightbox 15 open={open} 16 close={() => setOpen(false)} 17 slides={[ 18 { 19 src: "/image1x3840.jpg", 20 alt: "image 1", 21 width: 3840, 22 height: 2560, 23 srcSet: [ 24 { src: "/image1x320.jpg", width: 320, height: 213 }, 25 { src: "/image1x640.jpg", width: 640, height: 427 }, 26 { src: "/image1x1200.jpg", width: 1200, height: 800 }, 27 { src: "/image1x2048.jpg", width: 2048, height: 1365 }, 28 { src: "/image1x3840.jpg", width: 3840, height: 2560 }, 29 ], 30 }, 31 // ... 32 ]} 33 /> 34 </> 35 ); 36}
You can also integrate 3rd-party image components (e.g., Next.js Image or Gatsby Image) via a custom render function. See examples on the documentation website.
Yet Another React Lightbox allows you to add optional features to your project based on your requirements via plugins.
The following plugins are bundled in the package:
MIT © 2022 Igor Danchenko
No vulnerabilities found.
No security vulnerabilities found.