1
Install ios-haptics
2
Import haptic
3
Trigger a haptic on a button click
Pass
haptic directly as an event listener, or call it inside your handler.4
Try the different haptic types
ios-haptics exposes three feedback patterns based on context.
Complete example
A full TypeScript example with a button that cycles through all three haptic types.Next steps
API reference
Full documentation for
haptic(), haptic.confirm(), haptic.error(), and supportsHaptics.How it works
Learn about the Safari checkbox switch trick that powers ios-haptics under the hood.