Radical
Reference

Haptics API

Impact, notification, and selection feedback.

Native enablement is internalPlugins.haptics. The dependency is @capacitor/haptics@8.0.2. No runtime permission prompt is required.

Client exportArgumentsResult
hapticImpact(style?)"LIGHT", "MEDIUM", or "HEAVY". Default "MEDIUM".Effect of void
hapticNotification(type)"SUCCESS", "WARNING", or "ERROR"Effect of void
hapticSelectionEffect value with no argumentsEffect of void

These Effects require Bridge | BrowserHaptics. hapticsLive(effect) supplies BrowserHapticsLive. BrowserHaptics provides injectable vibrate(pattern) behavior. ImpactStyleSchema and NotificationTypeSchema validate inputs. Their types are ImpactStyle and NotificationType.

Browser resultBehavior
Vibration availableApproximate patterns
Missing API or vibrate returns falseSuccessful no-op
ExceptionHapticFeedbackFailed with cause
Hardware supportSuccess does not prove vibration; also applies to native devices
ErrorMeaning
BridgeErrorTransport or schema failure; invalid style or notification input produces BridgeDecodeError
HapticFeedbackFailedBrowser vibration exception; carries cause

useHapticFeedback() exposes light, medium, heavy, success, warning, error, selection, and impact, plus action state. The failure field is failure; error() is an action. A completed action sets value to true.

Platform support

CapabilityAndroidiOSBrowser
FeedbackNative hapticsNative hapticsVibration API or successful no-op

Source: haptics implementation.

On this page