use-haptic
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i use-haptic

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

6.14 kB

Total Files

9

Last publish

Collaborators

  • posaune0423