Skip to content

Platform Support ​

Web Haptic Engine automatically detects the best available haptic method on each platform and falls back gracefully.

How It Works ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   engine.trigger("success") β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
     β”‚ Platform Check β”‚
     β””β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”˜
         β”‚   β”‚   β”‚
    β”Œβ”€β”€β”€β”€β–Όβ” β”Œβ–Όβ”€β”€β” β”Œβ–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Android β”‚ β”‚ iOS β”‚ β”‚ Desktop  β”‚
    β”‚ vibrate β”‚ β”‚Tapticβ”‚ β”‚ (fallback)β”‚
    β””β”€β”€β”€β”€β”¬β”˜ β””β”¬β”€β”€β”˜ β””β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚   β”‚     β”‚
         β””β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”˜
         Audio Layer
      (all platforms)

Android ​

  • Method: navigator.vibrate() API
  • Capabilities: Full vibration patterns with intensity and timing control
  • Audio: Audio impulse layer reinforces each haptic event
  • Drag: Full haptic + audio on touch events
ts
// Check at runtime
HapticEngine.supportsVibration; // true on Android Chrome

iOS (Safari 17.5+) ​

  • Method: iOS Taptic Engine via hidden checkbox switch toggle
  • Capabilities: Crisp Taptic ticks (no pattern granularity)
  • Audio: Audio layer augments the Taptic feedback
  • Drag limitation: During continuous drag (touchmove), only audio fires β€” Taptic requires user activation (click events)

iOS Taptic Requirements

iOS Taptic feedback requires Safari 17.5+ and only fires on user-initiated click events. During drag interactions, the audio layer provides the feedback instead.

ts
// Check at runtime
HapticEngine.supportsIOSHaptics; // true on iOS Safari 17.5+

Desktop ​

  • Method: Web Audio impulse synthesis only (no vibration API)
  • Capabilities: 8 synthesized impulse types with gain control
  • Use case: Provides auditory feedback where physical haptics aren't available
ts
// Audio works everywhere with Web Audio support
const engine = new HapticEngine({ audioLayer: true });

Audio Impulse Types ​

All platforms support the audio layer. These 8 impulse types are synthesized at runtime using Web Audio. Each impulse buffer is peak-normalized with a fade-out tail for clean looping on sustained segments. The audio layer tracks all active sources (both single-fire and sequenced) for proper cancellation with a short gain ramp-down to prevent click/pop artifacts. On iOS, the AudioContext automatically recovers from system interruptions (phone calls, Siri):

ImpulseFrequencyCharacter
tick320 HzBright, crisp click
tap220 HzWarm, soft tap
thud160 HzDeep, heavy impact
click400 HzSharp, ultra-short
snap500 HzCrisp, snappy
buzz200 HzSustained vibration
confirm280 HzDual-tone affirming
harsh180 HzGritty, multi-harmonic

Feature Detection ​

ts
import { HapticEngine } from "web-haptic-engine";

// Static checks (no instantiation needed)
HapticEngine.supportsVibration; // Android vibration API
HapticEngine.supportsIOSHaptics; // iOS Taptic Engine
HapticEngine.isSupported; // Any native haptic method

// The engine gracefully degrades β€” audio always works
const engine = new HapticEngine();
await engine.trigger("success"); // Works on all platforms

Browser Compatibility ​

FeatureChromeSafariFirefoxEdge
Vibration API32+No16+79+
iOS TapticNo17.5+NoNo
Web Audio35+14.1+25+79+

TIP

The library always works β€” on platforms without native haptics, the audio layer provides feedback. No conditional code needed in your app.

Released under the MIT License.