Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-awesome-lightbox
Advanced tools
lightbox image viewer for react with zoom, rotate. Single or multi image mode and touch support
Lightbox image image viewer for react with zoom, rotate and move feature with single or multi image. Includes basic touch support.
To install, run the following command with your favourite package manager:
yarn add react-awesome-lightbox
Once installed, include it in your project like this:
import Lightbox from "react-awesome-lightbox";
// You need to import the CSS only once
import "react-awesome-lightbox/build/style.css";
<Lightbox image="image_url" title="Image Title">
let images = [
{
url:"image_url1",
title:"image title 1"
},
{
url:"image_url2",
title:"image title 2"
}
]
<Lightbox images={images}>
Lightbox can be customized with the following properties
property | default | description |
---|---|---|
image | n/a | URL to the image to show while in single image mode |
title | n/a | Title to show with the single image |
images | null | Takes an array of inage and starts the lightbox in multi image mode. *If you supply both image and images prop, image is ignored. supported formats : ["url1","url2"...] or [{url"url",title:"title"}...] |
startIndex | 0 | If the lightbox is in multiple image mode, the starting image index |
zoomStep | 0.3 | Step for zoom in or zoom out, 1 means 100% so, default 0.3 means 30% |
onClose | null | This function determines how to react when the close button is pressed |
allowZoom | true | Determines if image zoom controls should be shown |
allowRotate | true | Determine if image rotate controls should be shown |
allowReset | true | Determine if reset buttons should be shown |
buttonAlign | "flex-end" | Determine how to align the toolbar buttons options are: flex-end , flex-start , center |
showTitle | true | Determines if title should be shown if available |
keyboardInteraction | true | Determine if keyboard shortcuts will be allowed See below section for available Shortcuts |
doubleClickZoom | 4 | Determine how much to zoom in if double clicked. default 4 means close to 400%. Setting it to 0 will disable doubleclick/ double tap zoom |
onNavigateImage | null | Callback when image is navigated. It accepts the new index as its parameter. |
onClose
function (close the lightbox).All the styles are in the build/style.css
file. If you want to modify the CSS, download this file and customize it. then include the custom CSS file instead of the file from the package.
Released under the MIT license. Icons are from Icofont. Contributions are welcome 🖤
FAQs
lightbox image viewer for react with zoom, rotate. Single or multi image mode and touch support
The npm package react-awesome-lightbox receives a total of 6,627 weekly downloads. As such, react-awesome-lightbox popularity was classified as popular.
We found that react-awesome-lightbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.