Skip to content

react-native-haptic-feedbackHaptics that feel right

Core Haptics, AHAP files, pattern notation, and cross-platform utilities for iOS and Android.

Quick look โ€‹

ts
import HapticFeedback, {
  HapticFeedbackTypes,
} from "react-native-haptic-feedback";

// Single impact
HapticFeedback.trigger("impactMedium");

// Notification
HapticFeedback.trigger(HapticFeedbackTypes.notificationSuccess);
ts
import { pattern, playHaptic } from "react-native-haptic-feedback";

// Cross-platform: AHAP on iOS, pattern fallback on Android
await playHaptic("celebration.ahap", pattern("o.o.o.O"));
ts
import { useHaptics } from 'react-native-haptic-feedback';

function MyButton() {
  const haptics = useHaptics({ enableVibrateFallback: true });
  return <Pressable onPressIn={() => haptics.trigger('impactLight')} />;
}

Installation โ€‹

sh
npm install react-native-haptic-feedback
sh
yarn add react-native-haptic-feedback

Pre-release โ€” This docs site covers the next pre-release (3.0.0-next). For the stable v2 release see the GitHub README.

Released under the MIT License.