react-native-turbo-haptics
Version:
Fast, worklet-compatible haptic feedback for React Native
51 lines (38 loc) âĒ 1.02 kB
Markdown
for React Native.
- ðïļ 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
```sh
yarn add react-native-turbo-haptics
cd ios && pod install
```
## Usage
```ts
import { triggerHaptics } from 'react-native-turbo-haptics';
// In any JavaScript context:
triggerHaptics('selection');
// In worklets:
Gesture.Tap()
.onBegin(() => triggerHaptics('soft'));
```
```ts
// Available haptic types:
const HapticTypes = {
impactHeavy: 'impactHeavy',
impactLight: 'impactLight',
impactMedium: 'impactMedium',
notificationError: 'notificationError',
notificationSuccess: 'notificationSuccess',
notificationWarning: 'notificationWarning',
rigid: 'rigid',
selection: 'selection',
soft: 'soft',
};
```
MIT
Fast, **worklet-compatible** haptic feedback