@tauri-apps/plugin-haptics
Trigger haptic feedback on Android and iOS.
Functions
Section titled “Functions”impactFeedback()
Section titled “impactFeedback()”function impactFeedback(style: ImpactFeedbackStyle): Promise<Result<null, never>>;Defined in: plugins/haptics/guest-js/index.ts:55
Triggers an impact-feedback haptic, indicating a collision between user interface elements.
On iOS this maps to a UIImpactFeedbackGenerator of the given style. On Android, which has
no equivalent system API, each style plays a distinct vibration waveform. Has no effect on
desktop platforms.
Example
Section titled “Example”import { impactFeedback } from '@tauri-apps/plugin-haptics'await impactFeedback('medium')Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
style |
ImpactFeedbackStyle |
The style of the impact. |
Returns
Section titled “Returns”A promise resolving to the Result of the operation.
2.0.0
notificationFeedback()
Section titled “notificationFeedback()”function notificationFeedback(type: NotificationFeedbackType): Promise<Result<null, never>>;Defined in: plugins/haptics/guest-js/index.ts:78
Triggers a notification-feedback haptic, indicating the outcome of a task or action.
On iOS this maps to a UINotificationFeedbackGenerator of the given type. On Android, which
has no equivalent system API, each type plays a distinct vibration waveform. Has no effect on
desktop platforms.
Example
Section titled “Example”import { notificationFeedback } from '@tauri-apps/plugin-haptics'await notificationFeedback('success')Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
type |
NotificationFeedbackType |
The outcome to convey. |
Returns
Section titled “Returns”A promise resolving to the Result of the operation.
2.0.0
selectionFeedback()
Section titled “selectionFeedback()”function selectionFeedback(): Promise<Result<null, never>>;Defined in: plugins/haptics/guest-js/index.ts:98
Triggers a haptic indicating that a selection changed, e.g. the value of a picker control.
Has no effect on desktop platforms.
Example
Section titled “Example”import { selectionFeedback } from '@tauri-apps/plugin-haptics'await selectionFeedback()Returns
Section titled “Returns”A promise resolving to the Result of the operation.
2.0.0
vibrate()
Section titled “vibrate()”function vibrate(duration: number): Promise<Result<null, never>>;Defined in: plugins/haptics/guest-js/index.ts:34
Triggers a vibration for duration milliseconds.
Has no effect on desktop platforms.
Example
Section titled “Example”import { vibrate } from '@tauri-apps/plugin-haptics'await vibrate(300)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
duration |
number |
Duration of the vibration, in milliseconds. |
Returns
Section titled “Returns”A promise resolving to the Result of the operation.
2.0.0
Type Aliases
Section titled “Type Aliases”ImpactFeedbackStyle
Section titled “ImpactFeedbackStyle”type ImpactFeedbackStyle = "light" | "medium" | "heavy" | "soft" | "rigid";Defined in: plugins/haptics/guest-js/bindings.ts:83
The style of an impact-feedback haptic.
On iOS this maps directly to a UIImpactFeedbackGenerator.FeedbackStyle case. On Android,
which has no equivalent system API, each style instead plays a distinct vibration waveform of
increasing intensity. Has no effect on desktop platforms. Defaults to Medium.
NotificationFeedbackType
Section titled “NotificationFeedbackType”type NotificationFeedbackType = "success" | "warning" | "error";Defined in: plugins/haptics/guest-js/bindings.ts:96
The type of notification feedback, indicating the outcome of a task or action.
On iOS this maps directly to a UINotificationFeedbackGenerator.FeedbackType case. On
Android, which has no equivalent system API, each type instead plays a distinct vibration
waveform. Has no effect on desktop platforms. Defaults to Success.
© 2026 Tauri Contributors. CC-BY / MIT