Test Vibration API
Vibration API: Not Supported
Test on a mobile device or emulator with vibration support
The Vibration API allows web apps to access device vibration hardware. Patterns are defined as arrays: vibrate duration, pause, vibrate, pause... Not available on iOS Safari. Works on Android Chrome and some desktop browsers.
Predefined vibration patterns
[50]
Short single vibration
Use: Form submission, toggle on
[100, 50, 100]
Double pulse
Use: Validation error, rejected action
[200]
Medium single vibration
Use: Destructive action confirmation
[50, 100, 50, 100, 50]
Triple short pulses
Use: New message, alert
[10]
Very short tap
Use: Button press, list selection
[300]
Extended vibration
Use: Context menu, drag start
... --- ... (Short-Long-Short pulses)
Haptic event history
Trigger a pattern to see events
// navigator.vibrate(pattern) // pattern = [vibrate, pause, vibrate, pause, ...] // Single vibration navigator.vibrate(200); // 200ms // Pattern navigator.vibrate([100, 50, 100]); // vibrate 100ms, pause 50ms, vibrate 100ms // Stop vibration navigator.vibrate(0); // or navigator.vibrate([]);
Best practices for haptic feedback
Automation hints