UNPKG

tactus

Version:

Add native-like haptic feedback to any web app.

39 lines (26 loc) β€’ 977 B
# Tactus 🌡 Give your web app a little _tap of magic_β€”add native-style haptic feedback to every click. ## πŸš€ Install ```bash npm install tactus ``` ## Usage ```jsx import { triggerHaptic } from "tactus"; export default function BuyButton() { return <button onClick={() => triggerHaptic()}>Buy now</button>; } ``` `triggerHaptic(duration?)` fires one haptic pulse. - No argument β†’ 100 ms by default - iPhone / iPad β†’ Safari’s crisp β€œtick” πŸ’₯ - Other browsers β†’ falls back to the Vibration API πŸ“³ ## 🌐 Browser support | Platform | Supported | Notes | | ----------------------------- | --------- | ----------------- | | iOS 12 + (Safari & web-views) | βœ… | Native (switch) | | Android 5 + | βœ… | Vibrations API | | Desktop | 🚫 | Not supported yet | ## πŸ“„ License MIT Β© 2025 Aadee Made with ❀️ by [Aadee](https://x.com/aadeexyz)