A comprehensive React Native library for rich haptic feedback with Core Haptics on iOS, advanced patterns on Android, and cross-platform utilities.
react-native-haptic-feedback is a React Native library that provides rich, cross-platform haptic feedback for mobile applications. It solves the problem of inconsistent and limited tactile feedback in React Native by offering a unified API that taps into advanced native haptic systems like iOS Core Haptics and Android's VibrationEffect.Composition. Developers can trigger predefined feedback types, create custom patterns, and even play designer-created AHAP files.
React Native developers building iOS and Android apps who want to enhance user experience with high-quality, platform-appropriate haptic feedback. It's particularly valuable for developers creating interactive apps like games, productivity tools, or any application where tactile response improves usability.
Developers choose this library because it is the most complete haptic solution for React Native, offering deeper native integration than alternatives. Its unique selling points include support for Apple's Core Haptics and AHAP files, a rich Android Composition API, a developer-friendly hook and component, and intelligent cross-platform fallbacks that ensure haptics work reliably across a wide range of devices.
Haptics that feel right: Core Haptics, AHAP files, pattern notation, and cross-platform utilities for iOS and Android.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages iOS Core Haptics (iOS 13+) and Android VibrationEffect.Composition (API 31+) for high-quality, platform-specific tactile feedback, as detailed in the platform internals fallback chains.
Supports custom pattern notation (e.g., 'oO.O'), AHAP file playback for designer-created haptics, and over 30 predefined feedback types like 'impactMedium' and 'notificationSuccess'.
Includes a useHaptics hook, TouchableHaptic component, and helper functions like pattern() for easy integration, reducing boilerplate code in React Native apps.
Implements tiered fallback chains on iOS (Core Haptics → UIKit generators → vibration) and Android (performHapticFeedback → Vibrator API) to ensure broad device compatibility.
Using AHAP files requires manual addition to Xcode projects and understanding of Apple's haptic design tools, which the README admits is not bundled by Metro or CocoaPods.
Web relies on basic Vibration API, and on devices without Core Haptics or advanced vibrators, fallbacks to simple vibration may degrade the intended experience.
Breaking changes in React Native or platform APIs can affect compatibility, as seen in the v2 to v3 migration that raised minimum iOS and React Native versions.