Vibration API Demo

HomeSimple DemoSample App

Vibration Controls

Experiment with different vibration patterns

Duration: 500ms

About the Vibration API

The Vibration API allows web apps to access the device's vibration hardware. It's primarily available on mobile devices.

For vibration patterns, you provide an array of numbers where:

  • Odd positions (1st, 3rd, etc.) specify vibration duration in milliseconds
  • Even positions (2nd, 4th, etc.) specify pause duration in milliseconds

Note: Some devices may ignore specific pattern timings and use their own vibration patterns.

This demo works best on iOS 18+ and Android devices. Earlier iOS versions may not support vibration.