Getting Started
Requirements
| Platform | Minimum |
|---|---|
| iOS | 13.0 |
| Android | API 23 (Android 6.0) |
| React Native | 0.71.0 |
| Web | Browsers with Vibration API |
Installation
sh
npm install react-native-haptic-feedbacksh
yarn add react-native-haptic-feedbackiOS — CocoaPods
sh
cd ios && pod installNo manual linking needed — the library uses React Native's auto-linking.
Android
No extra steps. Auto-linking handles everything.
Expo managed workflow
Add the plugin to your app.config.js:
js
export default {
plugins: ["react-native-haptic-feedback"],
};No permissions or entitlements are needed — haptic feedback is a device-output function.
Basic usage
Trigger a single haptic
ts
import HapticFeedback from "react-native-haptic-feedback";
HapticFeedback.trigger("impactMedium");Use the enum for type safety
ts
import HapticFeedback, {
HapticFeedbackTypes,
} from "react-native-haptic-feedback";
HapticFeedback.trigger(HapticFeedbackTypes.notificationSuccess);Pass options
ts
HapticFeedback.trigger("impactHeavy", {
enableVibrateFallback: true, // vibrate on unsupported iOS devices
ignoreAndroidSystemSettings: false, // respect Android silent/vibrate mode
});Named exports
Everything you need can be imported individually:
ts
import {
// Core methods
trigger,
impact,
stop,
isSupported,
triggerPattern,
getSystemHapticStatus,
setEnabled,
isEnabled,
// iOS-only
playAHAP,
// Cross-platform
playHaptic,
// Pattern helpers
pattern,
Patterns,
PATTERN_CHARS,
// React integration
useHaptics,
TouchableHaptic,
// Enum & types
HapticFeedbackTypes,
} from "react-native-haptic-feedback";Checking device support
ts
import {
isSupported,
getSystemHapticStatus,
isRingerSilent,
} from "react-native-haptic-feedback";
if (isSupported()) {
const status = await getSystemHapticStatus();
console.log(status.vibrationEnabled); // true/false
console.log(status.ringerMode); // 'normal' | 'vibrate' | 'silent' | null
if (isRingerSilent(status)) {
// Android: device is in silent mode
}
}On iOS,
ringerModeis alwaysnull— the OS does not expose it publicly.
Next steps
- Pattern notation — compose multi-event sequences
- iOS guide — Core Haptics & AHAP files
- Android guide — API levels & haptic constants
- useHaptics hook — React integration
- TouchableHaptic — drop-in pressable with haptics