Gathering detailed insights and metrics for react-viewport-utils
Gathering detailed insights and metrics for react-viewport-utils
Gathering detailed insights and metrics for react-viewport-utils
Gathering detailed insights and metrics for react-viewport-utils
npm install react-viewport-utils
Typescript
Module System
Min. Node Version
Node Version
NPM Version
63.2
Supply Chain
92.9
Quality
76.2
Maintenance
100
Vulnerability
99.6
License
TypeScript (98.64%)
JavaScript (1.36%)
Total Downloads
536,646
Last Day
43
Last Week
1,088
Last Month
7,021
Last Year
81,440
18 Stars
236 Commits
7 Forks
4 Watching
11 Branches
5 Contributors
Latest Version
2.0.2
Package Id
react-viewport-utils@2.0.2
Unpacked Size
5.04 MB
Size
2.09 MB
File Count
382
NPM Version
8.1.0
Node Version
16.12.0
Cumulative downloads
Total Downloads
Last day
-81%
43
Compared to previous day
Last week
4.4%
1,088
Compared to previous week
Last month
16%
7,021
Compared to previous month
Last year
-25.4%
81,440
Compared to previous year
1
1
A set of low level utility components for react to make working with the viewport (e.g scroll position or size of the page) easy to use and performant by default.
See the example folder for more information about what you can build with it.
On a website with more sophisticated user interactions a lot of components need access to viewport information to e.g. know whether they are in the viewport, should resize or trigger an animation.
Most of the libraries reimplement the required functionality for that kind of features on its own over and over again. Those functionalities are not just hard to implement but can also, if not done well, cause the UX to suffer by introducing layout thrashing and therefore jank and will also cause the bundle size to grow which reduce the time to interaction. Further its hard to prioritize between highly and less important events if the implementation is not bundled in one central position.
This library solves all those issues by
onUpdate
callbacks, render props, higher order components and hooks which make the developer experience as simple as possible and allows the developer to concentrate on the application and not on global event handling.Please note that react
version 16.3 or higher is required for this library to work because it is using the context as well as references api.
npm install --save react-viewport-utils
By default the library ships with Typescript definitions, so there is no need to install a separate dependency. Typescript is no a requirement, all type definition are served within separate files.
For detection of some resize events the ResizeObserver
API is used internally which is not supported in some browsers. Please make sure to implement a polyfill on your own in case its required for your application.
The goal is to support the most recent versions of all major browsers (Edge, Safari, Chrome and Firefox).
We try to be downward compatible with older browsers when possible to at least not throw errors, but older versions will not be test at all.
In case you have specific requirements, please fill an issue or create a PR so we can discuss about them.
The project aims to support recent releases of v8 and v10 and higher of NodeJS.
ViewportProvider
ObserveViewport
connectViewport
useViewport
useMutableViewport
useScroll
useDimensions
useLayoutSnapshot
useViewportEffect
useScrollEffect
useDimensionsEffect
useRect
useRectEffect
Licensed under the MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/28 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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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