{"id":28705024,"url":"https://github.com/oblador/react-native-nitro-haptics","last_synced_at":"2025-06-14T14:09:26.791Z","repository":{"id":269885037,"uuid":"908518632","full_name":"oblador/react-native-nitro-haptics","owner":"oblador","description":"📳 Low Latency Haptic Feedback with Worklet Support for React Native","archived":false,"fork":false,"pushed_at":"2025-02-26T10:06:23.000Z","size":599,"stargazers_count":122,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T04:55:42.874Z","etag":null,"topics":["haptic-feedback","haptics","nitro","nitro-module","react-native","reanimated","worklet"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/oblador.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2024-12-26T09:13:36.000Z","updated_at":"2025-06-12T17:40:10.000Z","dependencies_parsed_at":"2024-12-26T22:56:40.715Z","dependency_job_id":"522fe793-fbc5-4e0b-aa2b-4385eb2bc731","html_url":"https://github.com/oblador/react-native-nitro-haptics","commit_stats":null,"previous_names":["oblador/react-native-nitro-haptics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oblador/react-native-nitro-haptics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oblador%2Freact-native-nitro-haptics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oblador%2Freact-native-nitro-haptics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oblador%2Freact-native-nitro-haptics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oblador%2Freact-native-nitro-haptics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oblador","download_url":"https://codeload.github.com/oblador/react-native-nitro-haptics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oblador%2Freact-native-nitro-haptics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259827667,"owners_count":22917714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["haptic-feedback","haptics","nitro","nitro-module","react-native","reanimated","worklet"],"created_at":"2025-06-14T14:09:25.643Z","updated_at":"2025-06-14T14:09:26.777Z","avatar_url":"https://github.com/oblador.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nitro Haptics\n\n### Low Latency Haptic Feedback with Worklet Support for React Native\n\n[![Follow oblador on Bluesky ](https://img.shields.io/badge/Bluesky-0285FF?style=social\u0026logo=bluesky\u0026label=oblador.bsky.social)](https://bsky.app/profile/oblador.bsky.social) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/trastknast)](https://x.com/trastknast) [![GitHub followers](https://img.shields.io/github/followers/oblador)](https://github.com/oblador)\n\n---\n\n[![CI](https://github.com/oblador/react-native-nitro-haptics/actions/workflows/ci.yml/badge.svg)](https://github.com/oblador/react-native-nitro-haptics/actions/workflows/ci.yml) [![NPM Version](https://img.shields.io/npm/v/react-native-nitro-haptics)](https://www.npmjs.com/package/react-native-nitro-haptics) [![NPM License](https://img.shields.io/npm/l/react-native-nitro-haptics)](https://github.com/oblador/react-native-nitro-haptics/blob/master/LICENSE)\n\n## Features\n\n- **Low latency** for timing interaction and feedback perfectly, thanks to extremely fast [Nitro Modules](https://nitro.margelo.com)\n- **Worklet support** to ensure instant feedback even if JS thread is blocked\n- Built for **New Architecture** from the start\n- **Drop-in replacement** for `expo-haptics` for ease of adoption\n\n## Installation\n\nYou need to install both Nitro Modules core package and Nitro Haptics:\n\n```sh\nnpm install react-native-nitro-modules react-native-nitro-haptics\n# Don't forget to update CocoaPods and recompile app:\ncd ios \u0026\u0026 pod install\n```\n\n## Usage\n\nSee [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/playing-haptics) for best practices and references.\n\n```tsx\nimport { Haptics } from 'react-native-nitro-haptics';\n\n\u003cButton title=\"Press me\" onPress={() =\u003e Haptics.impact('medium')} /\u003e;\n```\n\n### Reanimated Worklets\n\nAssuming your app has been correctly configured with Reanimated, Nitro Haptics can be called directly from the UI thread by using [Nitro Modules Boxing](https://nitro.margelo.com/docs/worklets):\n\n```tsx\nimport { Gesture, GestureDetector } from 'react-native-gesture-handler';\nimport { Haptics } from 'react-native-nitro-haptics';\nimport { NitroModules } from 'react-native-nitro-modules';\nconst boxed = NitroModules.box(Haptics);\n\n\u003cGestureDetector\n  gesture={Gesture.Tap().onBegin(() =\u003e {\n    'worklet';\n    boxed.unbox().impact('medium');\n  })}\n/\u003e;\n```\n\n## API\n\n### `Haptics.impact(style: 'light' | 'medium' | 'heavy' | 'soft' | 'rigid')`\n\nImpact haptics provide a physical metaphor you can use to complement a visual experience. For example, people might feel a tap when a view snaps into place or a thud when two heavy objects collide.\n\n`style` argument maps to [`UIImpactFeedbackGenerator.FeedbackStyle`](https://developer.apple.com/documentation/uikit/uiimpactfeedbackgenerator/feedbackstyle), see [HIG for visualization](https://developer.apple.com/design/human-interface-guidelines/playing-haptics#Impact).\n\n### `Haptics.notification(type: 'success' | 'warning' | 'error')`\n\nNotification haptics provide feedback about the outcome of a task or action, such as depositing a check or unlocking a vehicle.\n\n`type` argument maps to [`UINotificationFeedbackGenerator.FeedbackType`](https://developer.apple.com/documentation/uikit/uinotificationfeedbackgenerator/feedbacktype), see [HIG for visualization](https://developer.apple.com/design/human-interface-guidelines/playing-haptics#Notification).\n\n### `Haptics.selection()`\n\nSelection haptics provide feedback while the values of a UI element are changing, see [HIG for visualization](https://developer.apple.com/design/human-interface-guidelines/playing-haptics#Selection).\n\n### `Haptics.performAndroidHaptics(type: 'confirm' | 'reject' | 'gesture-start' | 'gesture-end' | 'toggle-on' | 'toggle-off' | 'clock-tick' | 'context-click' | 'drag-start' | 'keyboard-tap' | 'keyboard-press' | 'keyboard-release' | 'long-press' | 'virtual-key' | 'virtual-key-release' | 'no-haptics' | 'segment-tick' | 'segment-frequent-tick' | 'text-handle-move')`\n\nAndroid equivalent to provide haptic feedback for some built in actions, such as long presses, but you may wish to provide feedback for your own widget, see [`HapticFeedbackConstants`](https://developer.android.com/reference/android/view/HapticFeedbackConstants.html) for uses.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foblador%2Freact-native-nitro-haptics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foblador%2Freact-native-nitro-haptics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foblador%2Freact-native-nitro-haptics/lists"}