The NPM Package Everyone Is Adding To Their Site (Web Haptics)
The web-haptics npm package enables haptic feedback on websites for both Android and iOS devices, making web apps feel more native. It exposes a simple React hook (useWebHaptics) with trigger, cancel, and isSupported utilities. Android support uses the standard navigator.vibrate API, while iOS support is achieved via a clever workaround: programmatically toggling an invisible checkbox input of type switch, which natively triggers haptic feedback on iOS. Custom vibration patterns can be defined with delay, duration, and intensity values, or chosen from built-in presets. A visual editor on the package's website helps design and preview custom patterns.