File: haptics.md | Updated: 11/15/2025
Hide navigation
Search
Ctrl K
Home Guides EAS Reference Learn
Reference version
SDK 54
Archive Expo Snack Discord and Forums Newsletter
Expo HapticsA library that provides access to the system's vibration effects on Android, the haptics engine on iOS, and the Web Vibration API on web.
Android
iOS
Web
Bundled version:
~15.0.7
Copy page
expo-haptics provides haptic (touch) feedback for:
On iOS, the Taptic engine will do nothing if any of the following conditions are true on a user's device:
expo-battery
.On web, the library uses the Web Vibration API. Note the following:
Terminal
Copy
- npx expo install expo-haptics
If you are installing this in an existing React Native app
, make sure to install expo
in your project.
On Android, this library requires permission to control vibration on the device. The VIBRATE permission is added automatically.
Haptics usage
Copy
Open in Snack
import { StyleSheet, View, Text, Button } from 'react-native'; import * as Haptics from 'expo-haptics'; export default function App() { return ( <View style={styles.container}> <Text style={styles.text}>Haptics.selectionAsync</Text> <View style={styles.buttonContainer}> <Button title="Selection" onPress={() => Haptics.selectionAsync()} /> </View> <Text style={styles.text}>Haptics.notificationAsync</Text> <View style={styles.buttonContainer}> <Button title="Success" onPress={ () => Haptics.notificationAsync( Haptics.NotificationFeedbackType.Success ) } /> <Button title="Error" onPress={ () => Haptics.notificationAsync( Haptics.NotificationFeedbackType.Error ) } /> <Button title="Warning" onPress={ () => Haptics.notificationAsync( Haptics.NotificationFeedbackType.Warning ) } /> </View> <Text style={styles.text}>Haptics.impactAsync</Text> <View style={styles.buttonContainer}> <Button title="Light" onPress={ () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light) } /> <Button title="Medium" onPress={ () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium) } /> <Button title="Heavy" onPress={ () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy) } /> <Button title="Rigid" onPress={ () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Rigid) } /> <Button title="Soft" onPress={ () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Soft) } /> </View> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', paddingHorizontal: 16, }, buttonContainer: { flexDirection: 'row', alignItems: 'stretch', marginTop: 10, marginBottom: 30, justifyContent: 'space-between', }, });
Show More
import * as Haptics from 'expo-haptics';
Haptics.impactAsync(style)| Parameter | Type | Description |
| --- | --- | --- |
| style(optional) | [ImpactFeedbackStyle](https://docs.expo.dev/versions/v54.0.0/sdk/haptics#impactfeedbackstyle) | A collision indicator that on Android is simulated using Vibrator<br> and on iOS, it is directly mapped to UIImpactFeedbackStyle<br>. You can use one of Haptics.ImpactFeedbackStyle.{Light, Medium, Heavy, Rigid, Soft}.<br><br>Default:ImpactFeedbackStyle.Medium |
Returns:
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <void>
A Promise which fulfills once native size haptics functionality is triggered.
See: Android's
VibratorAPI is not recommended for implementing haptics feedback. Instead, you should useperformAndroidHapticsAsync, which is similar to iOS haptic feedback and does not requireVIBRATEpermission.
Haptics.notificationAsync(type)| Parameter | Type | Description |
| --- | --- | --- |
| type(optional) | [NotificationFeedbackType](https://docs.expo.dev/versions/v54.0.0/sdk/haptics#notificationfeedbacktype) | A notification feedback type that on Android is simulated using Vibrator<br> and iOS is directly mapped to UINotificationFeedbackType<br>. You can use one of Haptics.NotificationFeedbackType.{Success, Warning, Error}.<br><br>Default:NotificationFeedbackType.Success |
The kind of notification response used in the feedback.
Returns:
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <void>
A Promise which fulfills once native size haptics functionality is triggered.
Haptics.performAndroidHapticsAsync(type)Only for:
Android
| Parameter | Type |
| --- | --- |
| type | [AndroidHaptics](https://docs.expo.dev/versions/v54.0.0/sdk/haptics#androidhaptics) |
Use the device haptics engine to provide physical feedback to the user.
Returns:
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <void>
Haptics.selectionAsync()Used to let a user know when a selection change has been registered.
Returns:
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <void>
A Promise which fulfills once native size haptics functionality is triggered.
AndroidHapticsOnly for:
Android
Clock_TickAndroidHaptics.Clock_Tick = "clock-tick"
The user has pressed either an hour or minute tick of a Clock.
ConfirmAndroidHaptics.Confirm = "confirm"
A haptic effect to signal the confirmation or successful completion of a user interaction.
Context_ClickAndroidHaptics.Context_Click = "context-click"
The user has performed a context click on an object.
Drag_StartAndroidHaptics.Drag_Start = "drag-start"
The user has started a drag-and-drop gesture. The drag target has just been "picked up".
Gesture_EndAndroidHaptics.Gesture_End = "gesture-end"
The user has finished a gesture (for example, on the soft keyboard).
Gesture_StartAndroidHaptics.Gesture_Start = "gesture-start"
The user has started a gesture (for example, on the soft keyboard).
Keyboard_PressAndroidHaptics.Keyboard_Press = "keyboard-press"
The user has pressed a virtual or software keyboard key.
Keyboard_ReleaseAndroidHaptics.Keyboard_Release = "keyboard-release"
The user has released a virtual keyboard key.
Keyboard_TapAndroidHaptics.Keyboard_Tap = "keyboard-tap"
The user has pressed a soft keyboard key.
Long_PressAndroidHaptics.Long_Press = "long-press"
The user has performed a long press on an object that results in an action being performed.
No_HapticsAndroidHaptics.No_Haptics = "no-haptics"
No haptic feedback should be performed.
RejectAndroidHaptics.Reject = "reject"
A haptic effect to signal the rejection or failure of a user interaction.
Segment_Frequent_TickAndroidHaptics.Segment_Frequent_Tick = "segment-frequent-tick"
The user is switching between a series of many potential choices. For example, minutes on a clock face or individual percentages. This constant is expected to be very soft, so as not to be uncomfortable when performed a lot in quick succession. If the device can't make a suitably soft vibration, then it may not make any vibration.
Segment_TickAndroidHaptics.Segment_Tick = "segment-tick"
The user is switching between a series of potential choices. For example, items in a list or discrete points on a slider.
Text_Handle_MoveAndroidHaptics.Text_Handle_Move = "text-handle-move"
The user has performed a selection/insertion handle move on text field.
Toggle_OffAndroidHaptics.Toggle_Off = "toggle-off"
The user has toggled a switch or button into the off position.
Toggle_OnAndroidHaptics.Toggle_On = "toggle-on"
The user has toggled a switch or button into the on position.
Virtual_KeyAndroidHaptics.Virtual_Key = "virtual-key"
The user has pressed on a virtual on-screen key.
Virtual_Key_ReleaseAndroidHaptics.Virtual_Key_Release = "virtual-key-release"
The user has released a virtual key.
ImpactFeedbackStyleThe mass of the objects in the collision simulated by a UIImpactFeedbackGenerator object UINotificationFeedbackStyle
.
HeavyImpactFeedbackStyle.Heavy = "heavy"
A collision between large, heavy user interface elements.
LightImpactFeedbackStyle.Light = "light"
A collision between small, light user interface elements.
MediumImpactFeedbackStyle.Medium = "medium"
A collision between moderately sized user interface elements.
RigidImpactFeedbackStyle.Rigid = "rigid"
A collision between user interface elements that are rigid, exhibiting a small amount of compression or elasticity.
SoftImpactFeedbackStyle.Soft = "soft"
A collision between user interface elements that are soft, exhibiting a large amount of compression or elasticity.
NotificationFeedbackTypeThe type of notification feedback generated by a UINotificationFeedbackGenerator object. UINotificationFeedbackType
.
ErrorNotificationFeedbackType.Error = "error"
A notification feedback type indicating that a task has failed.
SuccessNotificationFeedbackType.Success = "success"
A notification feedback type indicating that a task has completed successfully.
WarningNotificationFeedbackType.Warning = "warning"
A notification feedback type indicating that a task has produced a warning.