Demo

Vibration & haptics

Unified haptics: native ImpactStyle.Medium on mobile; WebHaptics in the browser.

Vibration & haptics

Unified haptics: native ImpactStyle.Medium on mobile; WebHaptics in the browser.

  • Methods: vibrate(options), cancel()
TSXVibration
1import { Vibration } from "@quan-erp/shared-frontend-core"; 2 3export function HapticConfirm() { 4 const haptics = Vibration.instance; 5 6 return ( 7 <> 8 <button type="button" onClick={() => void haptics.vibrate({})}> 9 Pulse 10 </button> 11 <button type="button" onClick={() => haptics.cancel()}> 12 Cancel 13 </button> 14 </> 15 ); 16}