Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Y

yet-another-react-lightbox

> 前端框架
Open source

Modern React lightbox component

1.3K stars0 likes2 views
WebsiteGitHub

About

Modern React lightbox component

Overview

  • Built for React: works with React 19, 18, 17, and 16.8.0+
  • UX: supports keyboard, mouse, touchpad, and touchscreen navigation
  • Preloading: never displays partially downloaded images
  • Performance: preloads limited number of images without compromising performance or UX
  • Responsive: responsive images with automatic resolution switching are supported out of the box
  • Video: video slides are supported via an optional plugin
  • Zoom: image zoom is supported via an optional plugin
  • Customization: customize any UI element or add your own custom slides
  • No bloat: never bundle rarely used features; add optional features via plugins
  • TypeScript: type definitions come built-in with the package
  • RTL: compatible with RTL layout

Documentation

https://yet-another-react-lightbox.com/documentation

Examples

https://yet-another-react-lightbox.com/examples

Changelog

https://github.com/igordanchenko/yet-another-react-lightbox/releases

Installation

bash
npm install yet-another-react-lightbox

Minimal Setup Example

javascript
import * 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" },
        ]}
      />
    
  );
}

Recommended Setup

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.

Plugins

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:

  • Captions - adds support for slide title and description
  • Counter - adds slides counter
  • Download - adds download button
  • Fullscreen - adds support for fullscreen mode
  • Inline - transforms the lightbox into an image carousel
  • Share - adds sharing button
  • Slideshow - adds slideshow button
  • Thumbnails - adds thumbnails track
  • Video - adds support for video slides
  • Zoom - adds image zoom feature

Sponsors

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.

License

MIT © 2022 Igor Danchenko

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptimageimage-carouselimage-lightboxlightbox

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架