coderef

Gamepad haptic feedbackLimited availability

The gamepad.vibrationActuator property represents a gamepad's haptics hardware, which allows you to control the vibration motors in a gamepad.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–67Not supported
68+Supportedsince Jul 24, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27
MobileChrome Android
18–67Not supported
68+Supportedsince Jul 24, 2018
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: hapticActuators.

Feature detection

JS · check before using
if ("GamepadHapticActuator" in globalThis) {
  // GamepadHapticActuator is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (11). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Gamepad.hapticActuators✕✕55✕✕55✕
Gamepad.vibrationActuator6879✕16.468✕✕
GamepadHapticActuator68155516.46855✕
GamepadHapticActuator.effects126126✕✕126✕✕
GamepadHapticActuator.effects.type_trigger-rumble126126✕✕126✕✕
GamepadHapticActuator.playEffect6815✕16.468✕✕
GamepadHapticActuator.playEffect.params_leftTrigger_parameter126126✕✕126✕✕
GamepadHapticActuator.playEffect.params_rightTrigger_parameter126126✕✕126✕✕
GamepadHapticActuator.playEffect.type_trigger-rumble126126✕✕126✕✕
GamepadHapticActuator.pulse✕✕55✕✕55✕
GamepadHapticActuator.reset6815✕16.468✕✕