Skip to content

christianbaroni/react-native-turbo-haptics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ€ Turbo Haptics

Fast, worklet-compatible haptic feedback for React Native.

Features

  • 🏎️ Zero-delay haptic feedback, powered by JSI
  • πŸͺ„ Compatible with Reanimated and Gesture Handler worklets
  • 🎯 9 different haptic patterns (impact, notification, selection)
  • πŸ“± iOS and Android support
  • πŸͺΆ Lightweight, zero dependencies

Installation

yarn add react-native-turbo-haptics
cd ios && pod install

Usage

import { triggerHaptics } from 'react-native-turbo-haptics';

// In any JavaScript context:
triggerHaptics('selection');

// In worklets:
Gesture.Tap()
  .onBegin(() => triggerHaptics('soft'));
// Available haptic types:
const HapticTypes = {
  impactHeavy: 'impactHeavy',
  impactLight: 'impactLight',
  impactMedium: 'impactMedium',
  notificationError: 'notificationError',
  notificationSuccess: 'notificationSuccess',
  notificationWarning: 'notificationWarning',
  rigid: 'rigid',
  selection: 'selection',
  soft: 'soft',
};

License

MIT