Socket
Socket
Sign inDemoInstall

react-swipe-events

Package Overview
Dependencies
11
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-swipe-events

Swipe (Touch) event for react component


Version published
Weekly downloads
189
decreased by-39.03%
Maintainers
1
Install size
5.75 MB
Created
Weekly downloads
 

Readme

Source

ReactSwipeEvents: React Swipe (Touch Event) enabler

Simple component to enable Swipe event for react component 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

  • 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

Last updated on 15 Mar 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc