taparoo

Simple touch handling React component

Usage no npm install needed!

<script type="module">
  import taparoo from 'https://cdn.skypack.dev/taparoo';
</script>

README

taparoo

React component for touch event handling

Install

$ npm install taparoo

Props

interface TaparooProps {
  onSwipe?: TaparooTouchEventHandler;
  onSwipeUp?: TaparooTouchEventHandler;
  onSwipeDown?: TaparooTouchEventHandler;
  onSwipeLeft?: TaparooTouchEventHandler;
  onSwipeRight?: TaparooTouchEventHandler;
  onTap?: TaparooTouchEventHandler;
  swipeThreshold?: number;
}

type TaparooTouchEventHandler = (event: TouchEvent, swipes?: Array<SwipeDirection>) => void;
Give it a little tappy.