A convenient React hook that utilizes input[switch]
introduced in Safari 18.0 to trigger haptic feedback anytime, anywhere in your application.
- Trigger haptic feedback at any time in your React application
- Simple API
npm install use-haptic
yarn add use-haptic
pnpm add use-haptic
bun add use-haptic
import { useHaptic } from "use-haptic";
function VibrationButton() {
const { vibe } = useHaptic();
return <button onClick={vibe}>Vibe</button>;
}
MIT