Socket
Socket
Sign inDemoInstall

yet-another-react-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yet-another-react-lightbox

Modern React lightbox component


Version published
Weekly downloads
110K
decreased by-3.21%
Maintainers
1
Weekly downloads
 
Created

What is yet-another-react-lightbox?

yet-another-react-lightbox is a React component for creating customizable lightbox galleries. It supports various features such as image zoom, fullscreen mode, and keyboard navigation, making it a versatile choice for displaying images in a modern web application.

What are yet-another-react-lightbox's main functionalities?

Basic Lightbox

This code demonstrates how to create a basic lightbox gallery with a set of images. The `Lightbox` component is imported and used with an array of image objects.

import Lightbox from 'yet-another-react-lightbox';
import 'yet-another-react-lightbox/styles.css';

const images = [
  { src: 'image1.jpg', alt: 'Image 1' },
  { src: 'image2.jpg', alt: 'Image 2' }
];

function App() {
  return (
    <Lightbox slides={images} />
  );
}

Fullscreen Mode

This code sample shows how to enable fullscreen mode in the lightbox. By adding the `fullscreen` prop to the `Lightbox` component, users can view images in fullscreen.

import Lightbox from 'yet-another-react-lightbox';
import 'yet-another-react-lightbox/styles.css';

const images = [
  { src: 'image1.jpg', alt: 'Image 1' },
  { src: 'image2.jpg', alt: 'Image 2' }
];

function App() {
  return (
    <Lightbox slides={images} fullscreen />
  );
}

Image Zoom

This code demonstrates how to enable image zoom functionality in the lightbox. By adding the `zoom` prop to the `Lightbox` component, users can zoom in on images.

import Lightbox from 'yet-another-react-lightbox';
import 'yet-another-react-lightbox/styles.css';

const images = [
  { src: 'image1.jpg', alt: 'Image 1' },
  { src: 'image2.jpg', alt: 'Image 2' }
];

function App() {
  return (
    <Lightbox slides={images} zoom />
  );
}

Keyboard Navigation

This code sample shows how to enable keyboard navigation in the lightbox. By adding the `keyboard` prop to the `Lightbox` component, users can navigate through images using the keyboard.

import Lightbox from 'yet-another-react-lightbox';
import 'yet-another-react-lightbox/styles.css';

const images = [
  { src: 'image1.jpg', alt: 'Image 1' },
  { src: 'image2.jpg', alt: 'Image 2' }
];

function App() {
  return (
    <Lightbox slides={images} keyboard />
  );
}

Other packages similar to yet-another-react-lightbox

Keywords

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc