tactus
Version:
Add native-like haptic feedback to any web app.
39 lines (26 loc) β’ 977 B
Markdown
Give your web app a little _tap of magic_βadd native-style haptic feedback to every click.
```bash
npm install tactus
```
```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 π³
| Platform | Supported | Notes |
| ----------------------------- | --------- | ----------------- |
| iOS 12 + (Safari & web-views) | β
| Native (switch) |
| Android 5 + | β
| Vibrations API |
| Desktop | π« | Not supported yet |
MIT Β© 2025 Aadee
Made with β€οΈ by [Aadee](https://x.com/aadeexyz)