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
isSupportedcheck 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.
Top comments (0)