Support matrix
| Platform | Browser | Support | Notes |
|---|---|---|---|
| iOS 17.4+ | Safari | Full haptic support | Uses the <input switch> checkbox trick |
| iOS < 17.4 | Safari | No haptic | <input switch> not supported |
| Android | Chrome / Firefox | Vibration only | Uses navigator.vibrate() |
| Desktop | All | None | No haptic or vibration API available |
| SSR | N/A | None | supportsHaptics returns false |
Calls to
haptic() on unsupported devices are safely no-ops — no errors are thrown and nothing breaks.Feature detection
UsesupportsHaptics to check for support before rendering haptic-related UI. This avoids showing UI hints on devices that will never fire a haptic.
supportsHaptics is true on any touchscreen device (iOS or Android) and false everywhere else, including SSR.