Gathering detailed insights and metrics for react-intersection-image
Gathering detailed insights and metrics for react-intersection-image
Gathering detailed insights and metrics for react-intersection-image
Gathering detailed insights and metrics for react-intersection-image
react-lazy-images
React utilities for lazy image loading
loadable-image
React Component to lazy load images
@t7/image
This is a React component that loads an image source, only after it is partially or fully visible in the viewport
lazy-image-renderer
A React component that optimizes image loading using Intersection Observer, providing smooth transitions and improved performance for lazy image rendering.
Lazy-loaded image component built with React Intersection
npm install react-intersection-image
Typescript
Module System
Node Version
NPM Version
63.1
Supply Chain
86.6
Quality
77.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
10,197
Last Day
1
Last Week
4
Last Month
32
Last Year
351
MIT License
11 Stars
34 Commits
8 Watchers
20 Branches
3 Contributors
Updated on Dec 18, 2024
Minified
Minified + Gzipped
Latest Version
2.1.2
Package Id
react-intersection-image@2.1.2
Unpacked Size
13.07 kB
Size
4.74 kB
File Count
5
NPM Version
6.14.10
Node Version
12.20.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-55.6%
4
Compared to previous week
Last Month
-8.6%
32
Compared to previous month
Last Year
-42.7%
351
Compared to previous year
1
20
React Intersection Image is a tiny lazy-loaded image component, built with React Intersection.
It uses the Intersection Observer API, so it's performant. It uses React Intersection, so it's tiny too!
By default, react-intersection-image
uses HTMLImageElement.decode()
to decode the image first before being rendered.
1npm install react-intersection-image --save
Simply swap an img
component for IntersectionImage
to load images when they enter the viewport:
1import IntersectionImage from 'react-intersection-image'; 2 3export default () => ( 4 <IntersectionImage src="path/to/image" /> 5);
IntersectionImage
switches opacity
from 0
to 1
when the image has loaded.
You can add a fade in animation by adding a CSS transition
rule via the method of your choosing. For instance:
1// `style` prop 2<IntersectionImage src="path/to/image" style={{ transition: 'opacity 500ms linear' }} /> 3 4// `className` prop 5<IntersectionImage src="path/to/image" className="with-transition" /> 6 7// Styled Components 8const Image = styled(IntersectionImage)` 9 transition: opacity 500ms linear; 10`;
IntersectionRoot
Because IntersectionImage
is built on React Intersection, it will subscribe to the nearest parent IntersectionRoot
(or the viewport if none exists).
We can create a new IntersectionRoot
on a different parent element or with a different margin
, and share that with other IntersectionElement
s:
1import { IntersectionRoot, IntersectionElement } from 'react-intersection'; 2import IntersectionImage from 'react-intersection-image'; 3 4const LoadMore = ({ onChange }) => ( 5 <IntersectionElement onChange={onChange}> 6 <li>{`Loading...`}</li> 7 </IntersectionElement> 8); 9 10export default ({ images, loadMoreImages }) => ( 11 <IntersectionRoot margin="0px 200px 0px 0px"> 12 <ul> 13 {images.forEach(({ src }) => ( 14 <li> 15 <IntersectionImage src={src} /> 16 </li> 17 ))} 18 <LoadMore onChange={loadMoreImages} /> 19 </ul> 20 </IntersectionRoot> 21);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
88 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More