Haptics

Haptic Feedback with expo-haptics

A short vibration confirms a press. expo-haptics (npx expo install expo-haptics, 57.0.3 for SDK 57) offers selectionAsync(), impactAsync(style) (Light to Heavy, Rigid, Soft) and notificationAsync(type) (Success, Warning, Error). On Android they use the Vibrator service, with the VIBRATE permission added for you; performAndroidHapticsAsync() uses the system's haptic constants and needs no permission.

Four haptic effects behind four buttons (HapticsDemo.js, excerpt)JavaScript
const effects = {
  selection: () => Haptics.selectionAsync(),
  impact: () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),
  success: () => Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),
  confirm: () => Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics.Confirm),
};

Tapping the four buttons logged:

Output of 66
 LOG  selection: resolved
 LOG  impact: resolved
 LOG  success: resolved
 LOG  confirm: resolved

An emulator has no motor, so test the feel on a phone. On iOS the Taptic Engine is silent in Low Power Mode or when haptics are off, so never make a vibration the only sign that something happened.