/react-long

A LongPress component for React

Primary LanguageJavaScript

🙋‍♂️ Made by @thekitze

Other projects:

  • 🏫 React Academy - Interactive React and GraphQL workshops
  • 💌 Twizzy - A standalone app for Twitter DM
  • 💻 Sizzy - A tool for testing responsive design on multiple devices at once
  • 🤖 JSUI - A powerful UI toolkit for managing JavaScript apps

react-long

Warning: works only on devices that support touch.

Demo

http://react-long.surge.sh

Example

<div>
  <LongPress
    time={1000}
    onLongPress={() => alert('pressed for 1s')}
    onPress={() => alert('pressed')}
  >
    <div>
      Hello world
    </div>
  </LongPress>
</div>