Modern React lightbox component
https://yet-another-react-lightbox.com/documentation
https://yet-another-react-lightbox.com/examples
https://github.com/igordanchenko/yet-another-react-lightbox/releases
npm install yet-another-react-lightboximport * as React from "react";
import Lightbox from "yet-another-react-lightbox";
import "yet-another-react-lightbox/styles.css";
export default function App() {
const [open, setOpen] = React.useState(false);
return (
<>
setOpen(true)}>
Open Lightbox
setOpen(false)}
slides={[
{ src: "/image1.jpg" },
{ src: "/image2.jpg" },
{ src: "/image3.jpg" },
]}
/>
);
}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.
…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:
This project is supported by the following companies, organizations, and individuals who help make its continued development and maintenance possible.
Support this project by becoming a sponsor. Both recurring and one-time contributions are very much appreciated.
MIT © 2022 Igor Danchenko
No open issues yet, or sync has not completed.