Free Tool

Haptic Pattern Studio

Design and test custom device vibrations using the native HTML5 Vibration API. Construct specific haptic feedback loops for successes, warnings, and notifications.

iOS Restriction: Apple does not currently support the HTML5 navigator.vibrate API on iOS Safari or iOS WebKit browsers. This tool and its generated code will perfectly trigger haptic engines on Android (Chrome, Edge, Firefox, Samsung Internet) and Windows devices with supported hardware.

HTML5 Vibration API FAQ

How does the navigator.vibrate() array work?

The navigator.vibrate() method accepts an array of integers representing milliseconds. The sequence strictly alternates between vibrating and pausing. The first value (index 0) is a vibration. The second value (index 1) is a pause. The third value (index 2) is a vibration, and so on. For example, [200, 100, 200] vibrates for 200ms, pauses for 100ms, and vibrates again for 200ms.

How do I stop an ongoing vibration pattern?

You can immediately cancel any ongoing vibration sequence by calling the API with a duration of zero: navigator.vibrate(0); or passing an empty array navigator.vibrate([]);.

Why doesn't the Vibration API work on iPhones?

Apple has historically restricted the HTML5 Vibration API in iOS Safari and the iOS WebKit engine citing battery and user-experience concerns. While PWAs added to the iOS Home Screen have gained many features recently (like Web Push), haptic feedback remains unsupported. It is always recommended to wrap navigator.vibrate in a feature detection check (if ("vibrate" in navigator)) to prevent console errors on iOS devices.

Is user interaction required to trigger haptics?

Yes. To prevent abuse (such as a website immediately buzzing your phone aggressively upon loading), most modern browsers require a user gesture (a click, tap, or form submission) before they will allow the navigator.vibrate() function to execute.

Your app here

Yes, PWAs can use haptic feedback!

They can also send push notifications. And with Progressier, it only takes a few clicks.

Generate PWA See plans