Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
react-modal-image
Advanced tools
A lightweight React component providing modal image Lightbox.
You need to bring your own Set
polyfill if you use old Internet Explorers.
import ModalImage from 'react-modal-image'
<ModalImage
small={urlToTinyImageFile}
large={urlToHugeImageFile}
alt="Hello World!"
/>
Prop | Type | Description |
---|---|---|
className | String | Optional. class for the small preview image. |
alt | String | Optional. alt for the small image and the heading text in Lightbox. |
small | URL | src for the small preview image. |
smallSrcSet | String | Optional. srcSet for the small preview image. |
medium | URL | Optional if large is defined. Image shown when zoomed out in Lightbox. |
large | URL | Optional if medium is defined. Image shown when zoomed in Lightbox. Downloadable. |
You can also choose to import only the Lightbox.
To use the Lightbox only, you'll need to handle the open state by yourself:
import { Lightbox } from "react-modal-image";
// ...
const closeLightbox = () => {
this.state.open = true;
};
// ...
{
this.state.open && (
<Lightbox
medium={urlToLargeImageFile}
large={urlToHugeImageFile}
alt="Hello World!"
onClose={this.closeLightbox}
/>
);
}
Prop | Type | Description |
---|---|---|
onClose | function | Will be invoked when the Lightbox requests to be closed |
FAQs
Lightweight Lightbox React Component
The npm package react-modal-image receives a total of 13,667 weekly downloads. As such, react-modal-image popularity was classified as popular.
We found that react-modal-image 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.