Web Haptics: Haptic Feedback on the Web
Web Haptics provides device vibration patterns, intensity controls, presets, and React, Vue, and Svelte wrappers, with an iOS workaround.
I came across an interesting library that lets you control device vibration directly from the web: different patterns, intensity levels, and scenarios. Under the hood, it uses the Web Haptics API (where available), with a convenient developer experience and ready-made presets on top.
There are wrappers for React, Vue, and Svelte, so you can integrate it painlessly into almost any modern stack.
You can use it in games, forms (for example, feedback on errors), micro-interactions, onboarding, and anywhere else where a “physical” response matters.
PS: iOS still doesn’t properly support native vibration (yes, seriously). So the authors resort to a hack: they create an invisible checkbox and programmatically “click” it under the hood. Apple, as usual, doing things its own special way 🥲