Skip to content

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

License

Notifications You must be signed in to change notification settings

posaune0423/use-haptic

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published