Skip to content

lochie/web-haptics

Repository files navigation

WebHaptics

Haptic feedback for the mobile web. Supports React, Vue, and Svelte.

Installation

npm i web-haptics

Usage

import { useWebHaptics } from "web-haptics/react";

function App() {
  const { trigger } = useWebHaptics();

  return <button onClick={() => trigger("success")}>Tap me</button>;
}

See the package README for Vue, Svelte, and vanilla examples.

Contributing

Install dependencies

pnpm install:all

Dev/Watch Library and Example

pnpm dev

Build Library

pnpm build

Found this useful?

Follow me on Twitter.

Other projects

You might also like:

  • Torph - Dependency-free animated text component.
  • easing.dev - Easily create custom easing graphs.

Acknowledgements

  • Special thanks to Alex for assistance with the site design.

About

Haptic feedback for the mobile web

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages