Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-swipe-events

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-swipe-events

Swipe (Touch) event for react component

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
73
decreased by-62.76%
Maintainers
1
Weekly downloads
 
Created
Source

ReactSwipeEvents: React Swipe (Touch Event) enabler

https://www.npmjs.com/package/react-swipe-events

This package is based on React-NPM-Boilerplate (https://github.com/juliancwirko/react-npm-boilerplate)

How to use ReactSwipeEvents

Install first

  • npm install --save react-swipe-events

Import this component

  • import ReactSwipeEvents from 'reactSwipeEvents'

Cover your component with ReactSwipeEvents

Props

Here is a list of accepted Props

  • screenXOffset: number - If start screenOffset (X) is higher than, no function will be called out
  • screenYOffset: number - If start screenOffset (Y) is higher than, no function will be called out
  • threshold: number - If delta between start and end of swipe below threshold no function will be called out
  • onSwiping: func - Call out this function when user swiping (onTouchMove)
  • onSwiped: func - Call out this function when user swiped (onTouchEnd)
  • onSwipedUp: func - Call out this function when user swiped up
  • onSwipedDown: func - Call out this function when user swiped down
  • onSwipedLeft: func - Call out this function when user swiped left
  • onSwipedRight: func - Call out this function when user swiped right

Returned parameter

  • onSwipedLeft, onSwipedRight will return (e, originalX, endX)
  • onSwipedTop, onSwipedDown will return (e, originalY, endY)
  • onSwiping will return (e, originalX, originalY, currentX, currentY, deltaX, deltaY)
  • onSwiped will return (e, originalX, originalY, endX, endY, deltaX, deltaY)

License

MIT

Keywords

FAQs

Package last updated on 18 Feb 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc