Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tijnjh/ios-haptics/llms.txt

Use this file to discover all available pages before exploring further.

ios-haptics works across iOS and Android, with graceful degradation on unsupported platforms.

Support matrix

PlatformBrowserSupportNotes
iOS 17.4+SafariFull haptic supportUses the <input switch> checkbox trick
iOS < 17.4SafariNo haptic<input switch> not supported
AndroidChrome / FirefoxVibration onlyUses navigator.vibrate()
DesktopAllNoneNo haptic or vibration API available
SSRN/ANonesupportsHaptics returns false
Calls to haptic() on unsupported devices are safely no-ops — no errors are thrown and nothing breaks.

Feature detection

Use supportsHaptics to check for support before rendering haptic-related UI. This avoids showing UI hints on devices that will never fire a haptic.
import { supportsHaptics } from 'ios-haptics'

if (supportsHaptics) {
  // show "tap for haptic feedback" hint
}
supportsHaptics is true on any touchscreen device (iOS or Android) and false everywhere else, including SSR.

Testing

Haptics do not fire in the iOS Simulator. You must test on a real physical device.
Use the CodePen demo to test haptics on a real device without setting up a local dev server.

Build docs developers (and LLMs) love