![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
yet-another-react-lightbox
Advanced tools
Readme
Modern React lightbox component. Performant, easy to use, customizable and extendable.
https://yet-another-react-lightbox.vercel.app/documentation
https://yet-another-react-lightbox.vercel.app/examples
npm install yet-another-react-lightbox
or
yarn add yet-another-react-lightbox
import * as React from "react";
import Lightbox from "yet-another-react-lightbox";
import "yet-another-react-lightbox/styles.css";
const App = () => {
const [open, setOpen] = React.useState(false);
return (
<>
<button type="button" onClick={() => setOpen(true)}>
Open Lightbox
</button>
<Lightbox
open={open}
close={() => setOpen(false)}
slides={[
{ src: "/image1.jpg" },
{ src: "/image2.jpg" },
{ src: "/image3.jpg" },
]}
/>
</>
);
};
export default App;
Unlike many other lightbox libraries, Yet Another React Lightbox doesn't have a concept of "thumbnail" or "original"
(or "full size") images. We use responsive images instead and recommend you provide multiple files of different
resolutions for each image. Yet Another React Lightbox automatically populates srcSet
/ sizes
attributes and lets
the browser decide which image is more appropriate for its viewport size.
import * as React from "react";
import Lightbox from "yet-another-react-lightbox";
import "yet-another-react-lightbox/styles.css";
const App = () => {
const [open, setOpen] = React.useState(false);
return (
<>
<button type="button" onClick={() => setOpen(true)}>
Open Lightbox
</button>
<Lightbox
open={open}
close={() => setOpen(false)}
slides={[
{
src: "/image1x3840.jpg",
alt: "image 1",
aspectRatio: 3 / 2,
srcSet: [
{ src: "/image1x320.jpg", width: 320 },
{ src: "/image1x640.jpg", width: 640 },
{ src: "/image1x1200.jpg", width: 1200 },
{ src: "/image1x2048.jpg", width: 2048 },
{ src: "/image1x3840.jpg", width: 3840 },
]
},
// ...
]}
/>
</>
);
};
export default App;
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 based on your requirements via plugins.
The following plugins come bundled in the package:
MIT © 2022 Igor Danchenko
FAQs
Modern React lightbox component
The npm package yet-another-react-lightbox receives a total of 79,425 weekly downloads. As such, yet-another-react-lightbox popularity was classified as popular.
We found that yet-another-react-lightbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.