use-haptic
v1.0.1
Published
Hooks for Haptic Feedback for mobile web
Downloads
24
Maintainers
Readme
use-haptic
A convenient React hook that utilizes input[switch]
introduced in Safari 18.0 to trigger haptic feedback anytime, anywhere in your application.
Features
- Trigger haptic feedback at any time in your React application
- Simple API
Install
npm install use-haptic
yarn add use-haptic
pnpm add use-haptic
bun add use-haptic
Usage
import { useHaptic } from "use-haptic";
function VibrationButton() {
const { vibe } = useHaptic();
return <button onClick={vibe}>Vibe</button>;
}
License
MIT