Gathering detailed insights and metrics for react-scroll-wheel-handler
Gathering detailed insights and metrics for react-scroll-wheel-handler
npm install react-scroll-wheel-handler
Typescript
Module System
Node Version
NPM Version
JavaScript (98.72%)
HTML (1.28%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
626,606
Last Day
779
Last Week
2,928
Last Month
13,621
Last Year
164,575
59 Stars
78 Commits
13 Forks
1 Watching
13 Branches
6 Contributors
Latest Version
2.2.0
Package Id
react-scroll-wheel-handler@2.2.0
Unpacked Size
17.41 kB
Size
6.58 kB
File Count
6
NPM Version
8.9.0
Node Version
18.2.0
Cumulative downloads
Total Downloads
Last day
6.7%
779
Compared to previous day
Last week
-18.3%
2,928
Compared to previous week
Last month
39.7%
13,621
Compared to previous month
Last year
-19.1%
164,575
Compared to previous year
28
Simple react component for handling scroll trackpad, arrow keys, swipe gestures and mouse wheel event.
#Update
add prop disableSwipe.
removed customStyle from props.
Replace CustomContainerComponent with CustomComponent. It must have ref passed as a prop. Example:
1const CustomComponent = forwardRef(({ children, ...props }, ref) => ( 2 <div ref={ref} {...props} id="custom"> 3 {children} 4 </div> 5));
1 npm install --save react-scroll-wheel-handler 2 or 3 yarn add react-scroll-wheel-handler
1import ReactScrollWheelHandler from "react-scroll-wheel-handler";
1<ReactScrollWheelHandler 2 upHandler={(e) => console.log("scroll up")} 3 downHandler={(e) => console.log("scroll down")} 4> 5 ... 6</ReactScrollWheelHandler>
#Props
All the other props are passed to the div/component returned.
1import React, { Component } from "react"; 2import ReactScrollWheelHandler from " react-scroll-wheel-handler"; 3 4class App extends React.Component { 5 state = { 6 currentIndex: 0, 7 colors: ["red", "black", "grey", "blue", "green"], 8 }; 9 nextIndex = () => { 10 const { colors, currentIndex } = this.state; 11 if (currentIndex == colors.length - 1) { 12 return this.setState({ currentIndex: 0 }); 13 } 14 15 return this.setState({ 16 currentIndex: currentIndex + 1, 17 }); 18 }; 19 20 prevIndex = () => { 21 const { colors, currentIndex } = this.state; 22 if (currentIndex == 0) { 23 return this.setState({ 24 currentIndex: colors.length - 1, 25 }); 26 } 27 28 return this.setState({ 29 currentIndex: currentIndex - 1, 30 }); 31 }; 32 33 render() { 34 const { colors, currentIndex } = this.state; 35 return ( 36 <div> 37 <ReactScrollWheelHandler 38 upHandler={this.prevIndex} 39 downHandler={this.nextIndex} 40 style={{ 41 width: "100%", 42 height: "100vh", 43 backgroundColor: colors[currentIndex], 44 transition: "background-color .4s ease-out", 45 }} 46 > 47 <h1>SCROLL FOR CHANGE BACKGROUND COLOR</h1> 48 </ReactScrollWheelHandler> 49 </div> 50 ); 51 } 52}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 4/21 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
dependency not pinned by hash detected -- score normalized to 0
Details
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
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
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