{"id":44120865,"url":"https://github.com/mhpdev-com/react-native-haptics","last_synced_at":"2026-02-08T19:28:39.002Z","repository":{"id":309210653,"uuid":"1031218028","full_name":"mhpdev-com/react-native-haptics","owner":"mhpdev-com","description":"A high-performance React Native library for iOS haptics and Android vibration effects","archived":false,"fork":false,"pushed_at":"2026-02-01T12:03:32.000Z","size":1718,"stargazers_count":23,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-01T19:37:59.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhpdev-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-03T09:17:31.000Z","updated_at":"2026-02-01T13:50:12.000Z","dependencies_parsed_at":"2025-08-10T16:23:58.522Z","dependency_job_id":"b06f19c2-d6bc-46e8-9e2a-12f399f7484d","html_url":"https://github.com/mhpdev-com/react-native-haptics","commit_stats":null,"previous_names":["mhpdev-com/react-native-haptics"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mhpdev-com/react-native-haptics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhpdev-com%2Freact-native-haptics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhpdev-com%2Freact-native-haptics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhpdev-com%2Freact-native-haptics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhpdev-com%2Freact-native-haptics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhpdev-com","download_url":"https://codeload.github.com/mhpdev-com/react-native-haptics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhpdev-com%2Freact-native-haptics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29240635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T18:06:38.086Z","status":"ssl_error","status_checked_at":"2026-02-08T18:06:09.124Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-08T19:28:38.403Z","updated_at":"2026-02-08T19:28:38.995Z","avatar_url":"https://github.com/mhpdev-com.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mhpdev.com\" target=\"_blank\"\u003e\n    \u003cimg src=\"./docs/banner.png\" alt=\"React Native Full Responsive Banner\" style=\"max-width:100%;height:auto;\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA high-performance React Native library for iOS haptics and Android vibration effects.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"./docs/USAGE.md\"\u003eDocumentation\u003c/a\u003e · \u003ca href=\"./example/\"\u003eExample\u003c/a\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n\u003e **Only New Architecture**: This library is only compatible with the new architecture. If you're using React Native 0.76 or higher, it is already enabled. However, if your React Native version is between 0.68 and 0.75, you need to enable it first. [Click here if you need help enabling the new architecture](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md)\n\n## Features\n\n- 🚀 \u0026nbsp;High-performance library built with Turbo Modules for Android and iOS\n\n- 🎛️ \u0026nbsp;Provides essential methods for triggering native haptic feedback\n\n- 🤖 \u0026nbsp;Supports a wide range of Android-specific vibration effects\n\n- 🛠️ \u0026nbsp;Easy to use with simple APIs\n\n- 🧵 \u0026nbsp;Executes on the UI thread to ensure instant feedback\n\n- ✅ \u0026nbsp;Fully type-safe and written in TypeScript\n\n## Installation\n\n### Bare React Native\n\nInstall the package using either npm or Yarn:\n\n```sh\nnpm install @mhpdev/react-native-haptics\n```\n\nOr with Yarn:\n\n```sh\nyarn add @mhpdev/react-native-haptics\n```\n\nFor iOS, navigate to the ios directory and install the pods:\n\n```sh\ncd ios \u0026\u0026 pod install\n```\n\n### Expo\n\nFor Expo projects, follow these steps:\n\n1. Install the package:\n\n   ```sh\n   npx expo install @mhpdev/react-native-haptics\n   ```\n\n2. Since it is not supported on Expo Go, run:\n\n   ```sh\n   npx expo prebuild\n   ```\n\n## Usage\n\nTo learn how to use the library, check out the [usage section](./docs/USAGE.md).\n\n## Benchmarks (RN Haptics vs Expo Haptics)\n\nThe following benchmark results are for 200 time executions ([Click here to see the full report repository](https://github.com/Mhp23/RN-Haptics-Benchmarks)):\n\n#### How much faster on iOS (iPhone 14 Pro Max)?\n\n| Effect               | React Native Haptics | Expo Haptics |   Speedup (RN / Expo) |\n| -------------------- | -------------------: | -----------: | --------------------: |\n| Impact Heavy         |                0.779 |        0.365 | 0.779 / 0.365 ≈ 2.13x |\n| Notification Success |                1.378 |        0.365 | 1.378 / 0.365 ≈ 3.78x |\n| Selection            |                0.602 |        0.350 | 0.602 / 0.350 ≈ 1.72x |\n\n#### How much faster on Android (Samsung A55)?\n\n| Effect               | React Native Haptics | Expo Haptics |                    Speedup (RN / Expo) |\n| -------------------- | -------------------: | -----------: | -------------------------------------: |\n| Impact Heavy         |                9.766 |        2.902 |                  9.766 / 2.902 ≈ 3.37x |\n| Notification Success |               10.837 |        3.433 |                 10.837 / 3.433 ≈ 3.16x |\n| Selection            |               11.236 |        3.037 |                 11.236 / 3.037 ≈ 3.70x |\n| Android Haptics      |                1.879 |        3.238 | 3.238 / 1.879 ≈ 1.72x (Expo is faster) |\n\n## Quick Start\n\n```tsx\nimport React from 'react';\nimport Haptics from '@mhpdev/react-native-haptics';\nimport {SafeAreaView, StyleSheet, Text, TouchableOpacity} from 'react-native';\n\nconst App: React.FC = () =\u003e {\n  const onImpactPress = () =\u003e {\n    Haptics.impact('heavy');\n  };\n\n  return (\n    \u003cSafeAreaView style={styles.container}\u003e\n      \u003cTouchableOpacity style={styles.button} onPress={onImpactPress}\u003e\n        \u003cText style={styles.buttonText}\u003eTrigger Heavy Impact\u003c/Text\u003e\n      \u003c/TouchableOpacity\u003e\n    \u003c/SafeAreaView\u003e\n  );\n};\n\nexport default App;\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  button: {\n    padding: 12.5,\n    borderRadius: 5,\n    backgroundColor: 'skyblue',\n  },\n  buttonText: {\n    fontSize: 22,\n    fontWeight: '600',\n  },\n});\n```\n\nTo become more familiar with the usage of the library, check out the [example project](./example/).\n\n## Testing\n\nTo mock the package's methods and components using the default mock configuration provided, follow these steps:\n\n- Create a file named `@mhpdev/react-native-haptics.ts` inside your `__mocks__` directory.\n\n- Copy the following code into that file:\n\n  ```js\n  jest.mock('@mhpdev/react-native-haptics', () =\u003e\n    require('@mhpdev/react-native-haptics/jest'),\n  );\n  ```\n\n## Contributing\n\nSee the [contributing guide](./CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","funding_links":[],"categories":["UI Components"],"sub_categories":["Haptics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhpdev-com%2Freact-native-haptics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhpdev-com%2Freact-native-haptics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhpdev-com%2Freact-native-haptics/lists"}