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

1.1.2 • Public • Published

use-haptic 📳

CI npm package downloads types included

A convenient React hook that utilizes input[switch] introduced in Safari 18.0 to trigger haptic feedback anytime, anywhere in your application.

Try Demo here !!!!! 👈🏻

Features

  • Trigger haptic feedback at any time in your React application
  • Simple API

Install

npm install use-haptic

Quick start

git clone https://github.com/posaune0423/use-haptic.git
cd sample
deno task dev

And you can visit the demo page by scanning the QR code displayed in the terminal.

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

132

Version

1.1.2

License

MIT

Unpacked Size

8.59 kB

Total Files

12

Last publish

Collaborators

  • posaune0423