@tauri-apps/plugin-haptics
このコンテンツはまだ日本語訳がありません。
Trigger haptic feedback on Android and iOS.
Type Aliases
Section titled “Type Aliases”ImpactFeedbackStyle
Section titled “ImpactFeedbackStyle”type ImpactFeedbackStyle = "light" | "medium" | "heavy" | "soft" | "rigid";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/bindings.ts#L83
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";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/bindings.ts#L96
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.
Functions
Section titled “Functions”impactFeedback()
Section titled “impactFeedback()”function impactFeedback(style): Promise<Result<null, never>>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/index.ts#L55
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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
style |
ImpactFeedbackStyle |
The style of the impact. |
Returns
Section titled “Returns”Promise<Result<null, never>>
A promise resolving to the Result of the operation.
Example
Section titled “Example”import { impactFeedback } from '@tauri-apps/plugin-haptics'await impactFeedback('medium')2.0.0
notificationFeedback()
Section titled “notificationFeedback()”function notificationFeedback(type): Promise<Result<null, never>>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/index.ts#L78
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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
type |
NotificationFeedbackType |
The outcome to convey. |
Returns
Section titled “Returns”Promise<Result<null, never>>
A promise resolving to the Result of the operation.
Example
Section titled “Example”import { notificationFeedback } from '@tauri-apps/plugin-haptics'await notificationFeedback('success')2.0.0
selectionFeedback()
Section titled “selectionFeedback()”function selectionFeedback(): Promise<Result<null, never>>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/index.ts#L98
Triggers a haptic indicating that a selection changed, e.g. the value of a picker control.
Has no effect on desktop platforms.
Returns
Section titled “Returns”Promise<Result<null, never>>
A promise resolving to the Result of the operation.
Example
Section titled “Example”import { selectionFeedback } from '@tauri-apps/plugin-haptics'await selectionFeedback()2.0.0
vibrate()
Section titled “vibrate()”function vibrate(duration): Promise<Result<null, never>>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/haptics/guest-js/index.ts#L34
Triggers a vibration for duration milliseconds.
Has no effect on desktop platforms.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
duration |
number |
Duration of the vibration, in milliseconds. |
Returns
Section titled “Returns”Promise<Result<null, never>>
A promise resolving to the Result of the operation.
Example
Section titled “Example”import { vibrate } from '@tauri-apps/plugin-haptics'await vibrate(300)2.0.0
© 2026 Tauri Contributors. CC-BY / MIT