Gathering detailed insights and metrics for @foo-software/react-lazy-offscreen-image
Gathering detailed insights and metrics for @foo-software/react-lazy-offscreen-image
Gathering detailed insights and metrics for @foo-software/react-lazy-offscreen-image
Gathering detailed insights and metrics for @foo-software/react-lazy-offscreen-image
A lazy loading React component to display a background image when in the viewport and the image is loaded.
npm install @foo-software/react-lazy-offscreen-image
Typescript
Module System
Node Version
NPM Version
JavaScript (95.2%)
CSS (4.8%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
36 Commits
1 Branches
1 Contributors
Updated on Jun 26, 2019
Latest Version
0.0.17
Package Id
@foo-software/react-lazy-offscreen-image@0.0.17
Unpacked Size
20.43 kB
Size
7.97 kB
File Count
14
NPM Version
6.4.1
Node Version
10.15.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
@foo-software/react-lazy-offscreen-image
React Lazy Offscreen Image exports a lazy loading React component to display a background image when in the viewport and the image is loaded. When analyzing website performance with tools like Lighthouse for example, often we find an opportunity for improvement in loading images below the fold, on demand - asynchronously. Lighthouse documentation explains the offscreen image performance metric in detail. This component provides lazy loading of images as an element with a backround image, when the user has scrolled it into the browser viewport. This technique is known as "lazy loading".
npm
npm install @foo-software/react-scroll-context @foo-software/react-lazy-offscreen-image
yarn
yarn add @foo-software/react-scroll-context @foo-software/react-lazy-offscreen-image
react@16.8
react-scroll-context
: Used to provide scroll data.Name | Description | PropType | Required | Default |
---|---|---|---|---|
children | Anything that can be rendered, but typically a tree of elements. The background image will be added to the container. children can optionally be specifid to render inside the container with the background image. | node | false | null |
className | An optional custom className to be added to the container. | string | false | null |
CustomTag | A custom HTML tag used for the container element. | string | false | div |
imageUrl | The image URL for the background image. | string | true | -- |
ScrollContext | A scroll Context object created by React.createContext() . You will need to use the same context as with react-scroll-context . This component depends on `react-scroll-context` to provide scroll data. | object | true | -- |
Example combined with react-scroll-context
.
1import React from 'react'; 2import { ScrollProvider } from '@foo-software/react-scroll-context'; 3import { LazyOffscreenImage } from '@foo-software/react-lazy-offscreen-image'; 4 5// replace `scroll-context` any name you like. 6const ScrollContext = React.createContext('scroll-context'); 7 8const App = () => ( 9 <ScrollProvider 10 Context={ScrollContext} 11 > 12 <div> 13 <h1>Scroll it!</h1> 14 <p>Ipsum lorem, a lot of content here...</p> 15 <LazyOffscreenImage 16 imageUrl="http://placekitten.com/300/300" 17 ScrollContext={ScrollContext} 18 /> 19 </div> 20 </ScrollProvider> 21);
An example using this component can be seen on Foo's features page.
This package was brought to you by Foo - a website performance monitoring tool. Create a free account with standard performance testing. Automatic website performance testing, uptime checks, charts showing performance metrics by day, month, and year. Foo also provides real time notifications when performance and uptime notifications when changes are detected. Users can integrate email, Slack and PagerDuty notifications.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 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 SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
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