DEV Community

Cover image for WebHaptics: Haptic Feedback for the Mobile Web
jQueryScript
jQueryScript

Posted on

WebHaptics: Haptic Feedback for the Mobile Web

WebHaptics: a JavaScript library that adds haptic feedback to mobile web apps, with dedicated adapters for React, Vue, Svelte, and vanilla TypeScript.

Key features:

  • Four built-in presets — success, nudge, error, buzz — ready to drop in
  • Custom vibration patterns via number, number[], Vibration[], or HapticPreset input
  • Debug audio mode for testing on desktop
  • Optional UI toggle switch for end users
  • Static isSupported check before any Vibration API call

One npm install, one hook import, and your mobile UI has physical feedback. Worth checking out if you're building anything interaction-heavy for mobile browsers.

👉 Blog Post

👉 GitHub Repo

👉 Live Demo

Top comments (0)