Skip to main content

Button with haptic feedback

Form submission

Use haptic.confirm() on successful submission and haptic.error() when validation fails.

React example

A React component that fires haptics based on the outcome of an async operation.

Conditional haptic UI

Use supportsHaptics to render a UI hint only on devices that will actually fire haptics.
In React:

Swipe gesture

Call haptic() inside a touch event handler to add tactile feedback to swipe interactions.