Lightweight haptic feedback for the web. Vibration API + iOS Safari 17.4+ fallback.
Tap the buttons below. Best experienced on a real device (Android or iOS Safari 17.4+).
npm i browser-hapticimport Haptic from "browser-haptic";
const MyButton = () => (
<button onClick={() => Haptic.heavy()}>
Tap me
</button>
);
if (Haptic.isSupported()) {
Haptic.success();
}