import { GestureDetector, GestureEvent } from 'fitbit-gestures'; // Get the element. You can also pass the element ID const element = document.getElementById('detectorElement'); const detector = new GestureDetector(element) .onTap((event: GestureEvent) => { //Do something }) .onDoubleTap((event: GestureEvent) => { //Do something }) .onLongPress((event: GestureEvent) => { //Do something }) .onSlide((event: GestureEvent) => { //Do something }) .onSwipe((event: GestureEvent) => { //Do something });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter