0.0.5 • Published 4 years ago

react-native-multitap v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-native-multitap

React Native multi tap component with the ability to handle single tap, double tap, triple tap, long press and all other props accepted by the Pressable component.

npm.io npm.io

Install

npm i react-native-multitap

Usage

import React from 'react'
import { Text, View } from 'react-native'
import MultiTap from 'react-native-multitap'

export default App() => {
    return (
        <MultiTap
            onDoubleTap={() => alert("Double tapped")}
            onSingleTap={() => alert("Single tapped")}
            onTripleTap={() => alert("Triple tapped")}
            onNTaps={(n) => { alert("I was tapped " + n + " times") }}
            onLongPress={() => alert("Long pressed")}
            delay={300}>
            <View>
                <Text>Tap Me</Text>
            </View>
        </MultiTap>
    )
}

Props

PropertyTypeDefaultDescription
delaynumber200Time for maximum delay between taps
onSingleTapfunction() => {}Callback for single tap event
onDoubleTapfunction() => {}Callback for double tap event
onTripleTapfunction() => {}Callback for triple tap event
onNTapsfunction() => {}Callback for more than 3 tap event

License

MIT