API Overview
Default export
ts
import HapticFeedback from "react-native-haptic-feedback";HapticFeedback is an object exposing all methods:
| Method | Returns | Description |
|---|---|---|
trigger(type, options?) | void | Fire a single haptic |
impact(type?, intensity?, options?) | void | Haptic with custom intensity |
triggerPattern(events, options?) | void | Play a HapticEvent[] sequence |
stop() | void | Stop ongoing haptics (iOS) |
isSupported() | boolean | Synchronous capability check |
playAHAP(fileName) | Promise<void> | Play an AHAP file — iOS only |
getSystemHapticStatus() | Promise<SystemHapticStatus> | Query ringer/vibration state |
setEnabled(value) | void | Library-wide kill switch |
isEnabled() | boolean | Read the kill-switch state |
Named exports
ts
import {
trigger,
impact,
stop,
isSupported,
triggerPattern,
playAHAP,
getSystemHapticStatus,
setEnabled,
isEnabled,
playHaptic,
pattern,
Patterns,
useHaptics,
TouchableHaptic,
HapticFeedbackTypes,
isRingerSilent,
} from "react-native-haptic-feedback";All methods from the default export are also available as named exports.
React hooks & components
| Export | Description |
|---|---|
useHaptics(defaultOptions?) | Hook with merged default options and stable references |
TouchableHaptic | Pressable wrapper with built-in haptic |
Utilities
| Export | Description |
|---|---|
pattern(notation) | Convert notation string → HapticEvent[] |
Patterns | Six named built-in presets |
playHaptic(ahap, fallback, options?) | Cross-platform AHAP/pattern bridge |
isRingerSilent(status) | Helper for SystemHapticStatus |
Types
| Export | Description |
|---|---|
HapticFeedbackTypes | Enum of all 34 haptic type strings |
HapticOptions | enableVibrateFallback, ignoreAndroidSystemSettings |
HapticEvent | Single event in a pattern sequence |
SystemHapticStatus | Result of getSystemHapticStatus() |
AhapType | Full AHAP document — iOS only |
PatternChar | 'o' | 'O' | '.' | '-' | '=' |