Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christianbaroni/react-native-turbo-haptics
Fast, worklet-compatible haptic feedback for React Native ð
https://github.com/christianbaroni/react-native-turbo-haptics
android haptic-feedback haptics ios react-native reanimated worklets
Last synced: 3 days ago
JSON representation
Fast, worklet-compatible haptic feedback for React Native ð
- Host: GitHub
- URL: https://github.com/christianbaroni/react-native-turbo-haptics
- Owner: christianbaroni
- License: mit
- Created: 2024-11-12T03:03:03.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-14T22:39:39.000Z (2 months ago)
- Last Synced: 2025-01-06T12:30:19.766Z (10 days ago)
- Topics: android, haptic-feedback, haptics, ios, react-native, reanimated, worklets
- Language: TypeScript
- Homepage:
- Size: 365 KB
- Stars: 81
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ð 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