---
description: Capacitor plugin for haptic feedback including impacts, notifications, vibrations, and custom haptic patterns on Android, iOS, and the web.
title: Capacitor Haptics Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/haptics.png
---

<!doctype html> 

[Skip to content ](#capacitor-haptics-plugin) 

[🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode. ](/blog/announcing-the-capacitor-vault-plugin/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* Haptics [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Migrating from @capacitor/haptics ](#migrating-from-capacitorhaptics)
* [ Platform behavior ](#platform-behavior)
* [ Changelog ](#changelog)
* [ License ](#license)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Migrating from @capacitor/haptics ](#migrating-from-capacitorhaptics)
* [ Platform behavior ](#platform-behavior)
* [ Changelog ](#changelog)
* [ License ](#license)

# Capacitor Haptics Plugin[¶](#capacitor-haptics-plugin "Permanent link")

Capacitor plugin to provide haptic feedback such as impacts, notifications, vibrations and custom haptic patterns.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

* 💥 **Impact**: Trigger impact haptic feedback with five different styles, including the modern `Rigid` and `Soft` styles.
* 🔔 **Notification**: Trigger notification haptic feedback for success, warning and error events.
* 🎯 **Selection**: Trigger selection haptic feedback for picker-style interactions.
* 🎼 **Custom patterns**: Play custom haptic patterns with per-event intensity and sharpness (Core Haptics on iOS, vibration effects on Android).
* 🤖 **Android haptics**: Perform semantic Android haptic feedback effects that respect the user's haptic feedback settings.
* 📳 **Vibrate**: Vibrate the device with a custom duration.
* 🔎 **Availability check**: Check if haptic feedback is available on the device.
* 🌐 **Web support**: Best-effort support for the Web using the Vibration API.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 0.x.x          | \>=8.x.x          | Active support |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-haptics` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-haptics
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

This plugin already declares the `android.permission.VIBRATE` permission in its manifest, so no additional configuration is required.

### iOS[¶](#ios "Permanent link")

No additional configuration is required for this plugin.

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-3-1)import {
[](#%5F%5Fcodelineno-3-2)  AndroidHapticType,
[](#%5F%5Fcodelineno-3-3)  Haptics,
[](#%5F%5Fcodelineno-3-4)  ImpactStyle,
[](#%5F%5Fcodelineno-3-5)  NotificationType,
[](#%5F%5Fcodelineno-3-6)} from '@capawesome/capacitor-haptics';
[](#%5F%5Fcodelineno-3-7)
[](#%5F%5Fcodelineno-3-8)const impact = async () => {
[](#%5F%5Fcodelineno-3-9)  await Haptics.impact({ style: ImpactStyle.Medium });
[](#%5F%5Fcodelineno-3-10)};
[](#%5F%5Fcodelineno-3-11)
[](#%5F%5Fcodelineno-3-12)const isAvailable = async () => {
[](#%5F%5Fcodelineno-3-13)  const { available } = await Haptics.isAvailable();
[](#%5F%5Fcodelineno-3-14)  return available;
[](#%5F%5Fcodelineno-3-15)};
[](#%5F%5Fcodelineno-3-16)
[](#%5F%5Fcodelineno-3-17)const notification = async () => {
[](#%5F%5Fcodelineno-3-18)  await Haptics.notification({ type: NotificationType.Success });
[](#%5F%5Fcodelineno-3-19)};
[](#%5F%5Fcodelineno-3-20)
[](#%5F%5Fcodelineno-3-21)const performAndroidHaptic = async () => {
[](#%5F%5Fcodelineno-3-22)  await Haptics.performAndroidHaptic({ type: AndroidHapticType.Confirm });
[](#%5F%5Fcodelineno-3-23)};
[](#%5F%5Fcodelineno-3-24)
[](#%5F%5Fcodelineno-3-25)const playPattern = async () => {
[](#%5F%5Fcodelineno-3-26)  await Haptics.playPattern({
[](#%5F%5Fcodelineno-3-27)    events: [
[](#%5F%5Fcodelineno-3-28)      { time: 0, intensity: 1, sharpness: 0.8 },
[](#%5F%5Fcodelineno-3-29)      { time: 0.2, intensity: 0.6, sharpness: 0.4 },
[](#%5F%5Fcodelineno-3-30)      { time: 0.4, intensity: 0.8, duration: 0.5 },
[](#%5F%5Fcodelineno-3-31)    ],
[](#%5F%5Fcodelineno-3-32)  });
[](#%5F%5Fcodelineno-3-33)};
[](#%5F%5Fcodelineno-3-34)
[](#%5F%5Fcodelineno-3-35)const selection = async () => {
[](#%5F%5Fcodelineno-3-36)  await Haptics.selectionStart();
[](#%5F%5Fcodelineno-3-37)  await Haptics.selectionChanged();
[](#%5F%5Fcodelineno-3-38)  await Haptics.selectionEnd();
[](#%5F%5Fcodelineno-3-39)};
[](#%5F%5Fcodelineno-3-40)
[](#%5F%5Fcodelineno-3-41)const vibrate = async () => {
[](#%5F%5Fcodelineno-3-42)  await Haptics.vibrate({ duration: 500 });
[](#%5F%5Fcodelineno-3-43)};
`

## API[¶](#api "Permanent link")

* [impact(...)](#impact)
* [isAvailable()](#isavailable)
* [notification(...)](#notification)
* [performAndroidHaptic(...)](#performandroidhaptic)
* [playPattern(...)](#playpattern)
* [selectionChanged()](#selectionchanged)
* [selectionEnd()](#selectionend)
* [selectionStart()](#selectionstart)
* [vibrate(...)](#vibrate)
* [Interfaces](#interfaces)
* [Enums](#enums)

### impact(...)[¶](#impact "Permanent link")

`[](#%5F%5Fcodelineno-4-1)impact(options?: ImpactOptions | undefined) => Promise<void>
`

Trigger an impact haptic feedback.

Use this to simulate a physical impact, for example when user interface elements collide or a drag operation snaps into place.

On Android, the impact style is mapped to a best-effort vibration effect.

| Param       | Type                            |
| ----------- | ------------------------------- |
| **options** | [ImpactOptions](#impactoptions) |

**Since:** 0.1.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-5-1)isAvailable() => Promise<IsAvailableResult>
`

Check if haptic feedback is available on the device.

On Android, this checks whether the device has a vibrator. On iOS, this checks whether the device supports haptic event playback. On the web, this checks whether the Vibration API is supported.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 0.1.0

---

### notification(...)[¶](#notification "Permanent link")

`[](#%5F%5Fcodelineno-6-1)notification(options?: NotificationOptions | undefined) => Promise<void>
`

Trigger a notification haptic feedback.

Use this to communicate that a task or action has succeeded, failed, or produced a warning.

On Android, the notification type is mapped to a best-effort vibration effect.

| Param       | Type                                        |
| ----------- | ------------------------------------------- |
| **options** | [NotificationOptions](#notificationoptions) |

**Since:** 0.1.0

---

### performAndroidHaptic(...)[¶](#performandroidhaptic "Permanent link")

`[](#%5F%5Fcodelineno-7-1)performAndroidHaptic(options: PerformAndroidHapticOptions) => Promise<void>
`

Perform a predefined Android haptic feedback effect.

In contrast to the other methods, this method does not use the vibrator but the semantic haptic feedback constants of the Android view system. This respects the user's haptic feedback settings.

Only available on Android.

| Param       | Type                                                        |
| ----------- | ----------------------------------------------------------- |
| **options** | [PerformAndroidHapticOptions](#performandroidhapticoptions) |

**Since:** 0.1.0

---

### playPattern(...)[¶](#playpattern "Permanent link")

`[](#%5F%5Fcodelineno-8-1)playPattern(options: PlayPatternOptions) => Promise<void>
`

Play a custom haptic pattern composed of individual haptic events.

On iOS, the pattern is played using Core Haptics with full support for intensity and sharpness. This requires a device with haptic event playback support (for example an iPhone with a Taptic Engine). Otherwise, the call rejects as unavailable.

On Android, the pattern is played using vibration effects. Intensity is only respected on devices with amplitude control.

On the web, the pattern is approximated using the Vibration API.

| Param       | Type                                      |
| ----------- | ----------------------------------------- |
| **options** | [PlayPatternOptions](#playpatternoptions) |

**Since:** 0.1.0

---

### selectionChanged()[¶](#selectionchanged "Permanent link")

`[](#%5F%5Fcodelineno-9-1)selectionChanged() => Promise<void>
`

Trigger a selection changed haptic feedback.

Call this method after `selectionStart()` whenever the selection changes.

On the web, this method does nothing.

**Since:** 0.1.0

---

### selectionEnd()[¶](#selectionend "Permanent link")

`[](#%5F%5Fcodelineno-10-1)selectionEnd() => Promise<void>
`

End a selection session.

Call this method when the user finishes a selection interaction.

On the web, this method does nothing.

**Since:** 0.1.0

---

### selectionStart()[¶](#selectionstart "Permanent link")

`[](#%5F%5Fcodelineno-11-1)selectionStart() => Promise<void>
`

Start a selection session.

Call this method when the user starts a selection interaction, for example when a picker starts scrolling. It prepares the haptic hardware to reduce the latency of subsequent `selectionChanged()` calls.

On the web, this method does nothing.

**Since:** 0.1.0

---

### vibrate(...)[¶](#vibrate "Permanent link")

`[](#%5F%5Fcodelineno-12-1)vibrate(options?: VibrateOptions | undefined) => Promise<void>
`

Vibrate the device.

| Param       | Type                              |
| ----------- | --------------------------------- |
| **options** | [VibrateOptions](#vibrateoptions) |

**Since:** 0.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### ImpactOptions[¶](#impactoptions "Permanent link")

| Prop      | Type                        | Description              | Default            | Since |
| --------- | --------------------------- | ------------------------ | ------------------ | ----- |
| **style** | [ImpactStyle](#impactstyle) | The style of the impact. | ImpactStyle.Medium | 0.1.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop          | Type    | Description                                                | Since |
| ------------- | ------- | ---------------------------------------------------------- | ----- |
| **available** | boolean | Whether or not haptic feedback is available on the device. | 0.1.0 |

#### NotificationOptions[¶](#notificationoptions "Permanent link")

| Prop     | Type                                  | Description                   | Default                  | Since |
| -------- | ------------------------------------- | ----------------------------- | ------------------------ | ----- |
| **type** | [NotificationType](#notificationtype) | The type of the notification. | NotificationType.Success | 0.1.0 |

#### PerformAndroidHapticOptions[¶](#performandroidhapticoptions "Permanent link")

| Prop     | Type                                    | Description                                    | Since |
| -------- | --------------------------------------- | ---------------------------------------------- | ----- |
| **type** | [AndroidHapticType](#androidhaptictype) | The Android haptic feedback effect to perform. | 0.1.0 |

#### PlayPatternOptions[¶](#playpatternoptions "Permanent link")

| Prop       | Type            | Description                                 | Since |
| ---------- | --------------- | ------------------------------------------- | ----- |
| **events** | HapticEvent\[\] | The haptic events that make up the pattern. | 0.1.0 |

#### HapticEvent[¶](#hapticevent "Permanent link")

| Prop          | Type   | Description                                                                                                                                                                                         | Default | Since |
| ------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----- |
| **duration**  | number | The duration of the event in seconds. If omitted, the event is a transient tap.                                                                                                                     |         | 0.1.0 |
| **intensity** | number | The intensity of the event as a value between 0 and 1. On Android, the intensity is only respected on devices with amplitude control.                                                               |         | 0.1.0 |
| **sharpness** | number | The sharpness of the event as a value between 0 and 1. A lower value results in a rounder, softer feedback while a higher value results in a crisper, more precise feedback. Only available on iOS. | 0.5     | 0.1.0 |
| **time**      | number | The relative time at which the event occurs, in seconds.                                                                                                                                            |         | 0.1.0 |

#### VibrateOptions[¶](#vibrateoptions "Permanent link")

| Prop         | Type   | Description                                                                       | Default | Since |
| ------------ | ------ | --------------------------------------------------------------------------------- | ------- | ----- |
| **duration** | number | The duration of the vibration in milliseconds. Only available on Android and Web. | 300     | 0.1.0 |

### Enums[¶](#enums "Permanent link")

#### ImpactStyle[¶](#impactstyle "Permanent link")

| Members    | Value    | Description                                                     | Since |
| ---------- | -------- | --------------------------------------------------------------- | ----- |
| **Heavy**  | 'HEAVY'  | A collision between large, heavy user interface elements.       | 0.1.0 |
| **Light**  | 'LIGHT'  | A collision between small, light user interface elements.       | 0.1.0 |
| **Medium** | 'MEDIUM' | A collision between moderately sized user interface elements.   | 0.1.0 |
| **Rigid**  | 'RIGID'  | A collision between hard or inflexible user interface elements. | 0.1.0 |
| **Soft**   | 'SOFT'   | A collision between soft or flexible user interface elements.   | 0.1.0 |

#### NotificationType[¶](#notificationtype "Permanent link")

| Members     | Value     | Description                                  | Since |
| ----------- | --------- | -------------------------------------------- | ----- |
| **Error**   | 'ERROR'   | A task or action has failed.                 | 0.1.0 |
| **Success** | 'SUCCESS' | A task or action has completed successfully. | 0.1.0 |
| **Warning** | 'WARNING' | A task or action has produced a warning.     | 0.1.0 |

#### AndroidHapticType[¶](#androidhaptictype "Permanent link")

| Members          | Value            | Description                                                                                                             | Since |
| ---------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------- | ----- |
| **ClockTick**    | 'CLOCK\_TICK'    | The user has pressed either an hour or minute tick of a clock.                                                          | 0.1.0 |
| **Confirm**      | 'CONFIRM'        | The confirmation of a user's action. On Android 10 and older, ContextClick is performed instead.                        | 0.1.0 |
| **ContextClick** | 'CONTEXT\_CLICK' | The user has performed a context click on an object.                                                                    | 0.1.0 |
| **KeyboardTap**  | 'KEYBOARD\_TAP'  | The user has pressed a virtual or software keyboard key.                                                                | 0.1.0 |
| **LongPress**    | 'LONG\_PRESS'    | The user has performed a long press on an object.                                                                       | 0.1.0 |
| **Reject**       | 'REJECT'         | The rejection or failure of a user's action. On Android 10 and older, LongPress is performed instead.                   | 0.1.0 |
| **ToggleOff**    | 'TOGGLE\_OFF'    | The user has toggled a switch or button into the off position. On Android 13 and older, ClockTick is performed instead. | 0.1.0 |
| **ToggleOn**     | 'TOGGLE\_ON'     | The user has toggled a switch or button into the on position. On Android 13 and older, ClockTick is performed instead.  | 0.1.0 |
| **VirtualKey**   | 'VIRTUAL\_KEY'   | The user has pressed on a virtual on-screen key.                                                                        | 0.1.0 |

## Migrating from `@capacitor/haptics`[¶](#migrating-from-capacitorhaptics "Permanent link")

This plugin is a drop-in replacement for the official `@capacitor/haptics` plugin with a few differences:

| @capacitor/haptics                       | Haptics                                                |
| ---------------------------------------- | ------------------------------------------------------ |
| impact() (defaults to ImpactStyle.Heavy) | impact() (defaults to ImpactStyle.Medium)              |
| impact({ style }) (Heavy, Medium, Light) | impact({ style }) (plus the new Rigid and Soft styles) |
| notification({ type })                   | notification({ type })                                 |
| vibrate({ duration })                    | vibrate({ duration })                                  |
| selectionStart()                         | selectionStart()                                       |
| selectionChanged()                       | selectionChanged()                                     |
| selectionEnd()                           | selectionEnd()                                         |
| —                                        | isAvailable()                                          |
| —                                        | performAndroidHaptic({ type })                         |
| —                                        | playPattern({ events })                                |

**Attention**: The default impact style changed from `ImpactStyle.Heavy` to `ImpactStyle.Medium`. If you rely on the old default, pass `ImpactStyle.Heavy` explicitly.

## Platform behavior[¶](#platform-behavior "Permanent link")

The haptic capabilities of the platforms differ. This plugin maps every method to the best available platform API:

| Method                    | Android                                     | iOS                                      | Web           |
| ------------------------- | ------------------------------------------- | ---------------------------------------- | ------------- |
| impact(...)               | Predefined or tuned vibration effects       | UIImpactFeedbackGenerator (all 5 styles) | Vibration API |
| notification(...)         | Tuned vibration waveforms                   | UINotificationFeedbackGenerator          | Vibration API |
| selection\*()             | Tick vibration effect                       | UISelectionFeedbackGenerator             | No-op         |
| vibrate(...)              | Vibrator with custom duration               | System vibration (fixed duration)        | Vibration API |
| performAndroidHaptic(...) | Haptic feedback constants (no vibrator)     | Not available                            | Not available |
| playPattern(...)          | Vibration effects (composition or waveform) | Core Haptics (intensity and sharpness)   | Vibration API |

Custom haptic patterns are strongest on iOS, where Core Haptics supports per-event intensity and sharpness. On Android, patterns are approximated using vibration effect primitives (Android 11+ with supported hardware) or amplitude-controlled waveforms. On the web, patterns are approximated using the Vibration API, which only supports on/off timings.

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/haptics/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/haptics/LICENSE).

July 7, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/haptics/#article", "headline": "Capacitor Haptics Plugin for Android, iOS & Web", "name": "Capacitor Haptics Plugin for Android, iOS & Web", "description": "Capacitor plugin for haptic feedback including impacts, notifications, vibrations, and custom haptic patterns on Android, iOS, and the web.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/haptics/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/haptics/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/haptics/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/haptics/#software", "name": "Capacitor Haptics Plugin for Android, iOS & Web", "description": "Capacitor plugin for haptic feedback including impacts, notifications, vibrations, and custom haptic patterns on Android, iOS, and the web.", "url": "https://capawesome.io/docs/sdks/capacitor/haptics/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
```
