
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-finger
Advanced tools
React Finger is a library of gesture events for React that allows developers to use a single set of events for both desktop and mobile devices.
React Finger is a library of gesture/shortcuts events for React that allows developers to use a single set of events for both desktop and mobile devices.
npm install react-finger --save
Gesture Events
Basic Events
Shortcuts Events
Host Events
Example 1: Hello React Finger
import { Finger } from "react-finger";
const FingeredDiv = Finger("div");
function Demo(){
return (
<FingeredDiv
onTap = { event=>console.log('onTap',event) }
onSwipe = { event=>console.log('onSwipe',event.direction) }
>
Something...
</FingeredDiv>
);
}
Example 2: Using useFingerEvents
import { useFingerEvents } from "react-finger";
function Demo(){
const events = useFingerEvents({
onTap: event=>console.log('onTap',event),
onSwipe: event=>console.log('onSwipe',event.direction),
});
return (
<div {...events}> Something... </div>
);
}
Example 3: Using createFingerEvents
import { createFingerEvents } from "react-finger";
class Demo extends Component {
events = createFingerEvents({
onTap: event=>console.log('onTap',event),
onSwipe: event=>console.log('onSwipe',event.direction),
});
render() {
return (
<div {...this.events}> Something... </div>
);
}
}
Example 4: Bound to the Document
import { FingerProxy } from "react-finger";
function Demo(){
return (
<FingerProxy
onTap = { event=>console.log('Tap on the document',event) }
/>
);
}
Example 5: Bound to the Boundary
import { FingerProxy, FingerProxyContainer } from "react-finger";
const YourBoundaryWrapper = FingerProxyContainer("div");
function Demo(){
return (
<YourBoundaryWrapper>
Something...
<FingerProxy
onTap = { event=>console.log('Tap on the Boundary',event) }
/>
Something...
</YourBoundaryWrapper>
);
}
Example 6: Binding shortcut keys
import { FingerProxy, FingerProxyContainer } from "react-finger";
const FingeredDiv = Finger("div");
function Demo(){
return (
<FingeredDiv
onShortcut = { event => {
event.when(['control','shift','a'], ()=>{
// Something...
});
event.when(['control','shift','b'], ()=>{
// Something...
});
}}
/>
);
}
FAQs
React Finger is a library of gesture events for React that allows developers to use a single set of events for both desktop and mobile devices.
The npm package react-finger receives a total of 12 weekly downloads. As such, react-finger popularity was classified as not popular.
We found that react-finger 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.