-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a0cbd8
commit 09782f6
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 🌀 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 | ||
|
||
```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', | ||
}; | ||
``` | ||
|
||
## License | ||
|
||
MIT |