npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-haptic-engine

v1.0.3

Published

Advanced haptic feedback and vibration control using Pure JSI for React Native

Downloads

11

Readme

react-native-haptic-engine 📳

A unified, high-performance haptic feedback & vibration library for React Native.

Bridge the gap between Android’s precise Vibrator API and iOS’s Taptic Engine with a single, simple function.


✨ Features

  • 📳 Unified API
    One function works seamlessly on both Android and iOS.

  • 🤖 Android Precision
    Control exact duration (milliseconds) and intensity (1–255).

  • 🍏 iOS Taptic Support
    Automatically maps vibration strength to Light / Medium / Heavy impact styles.

  • Zero Lag
    Pure native implementation for instant feedback.

  • 📱 Expo Compatible
    Works with Expo Development Builds (CNG).

  • 📦 Zero Dependencies


📦 Installation

npm install react-native-haptic-engine

🍏 iOS Setup (React Native CLI only)

If you are using React Native CLI, install CocoaPods:

cd ios && pod install && cd ..

📱 Expo Support

This library includes custom native code and will NOT work in Expo Go.

You must use a Development Build.

Steps

  1. Install the package:
npm install react-native-haptic-engine
  1. Rebuild your app:
npx expo run:android
# or
npx expo run:ios

✅ Final Verdict

| Environment | Supported | |-----------|-----------| | React Native CLI | ✅ Yes | | Expo Dev Client | ✅ Yes | | Expo Go | ❌ No |


🚀 Usage

import { vibrate, stop } from 'react-native-haptic-engine';

// 1. Light Tick (toggle / selection)
// Android: 50ms at low power
// iOS: Light Impact
vibrate(50, 40);

// 2. Normal Tap (button press)
// Android: 100ms at medium power
// iOS: Medium Impact
vibrate(100, 150);

// 3. Heavy Thud (error / explosion)
// Android: 500ms at max power
// iOS: Heavy Impact
vibrate(500, 255);

// 4. Stop vibration (Android only)
stop();

📚 API Reference

vibrate(milliseconds, amplitude)

Triggers a haptic / vibration event.

| Parameter | Type | Default | Description | |---------|------|---------|-------------| | milliseconds | number | 400 | Android only. Duration of vibration. Ignored on iOS | | amplitude | number | 255 | Intensity from 1–255 |


📱 Platform Behavior Mapping

| Amplitude Range | Android Behavior | iOS Behavior | |----------------|-----------------|--------------| | 1 – 50 | Low intensity vibration | UIImpactFeedbackStyle.Light | | 51 – 150 | Medium intensity vibration | UIImpactFeedbackStyle.Medium | | 151 – 255 | High intensity vibration | UIImpactFeedbackStyle.Heavy |


stop()

Stops any ongoing vibration.

| Platform | Behavior | |--------|----------| | Android | Stops vibration immediately | | iOS | No-op (impact haptics are instantaneous) |


🛠 Troubleshooting

❌ "Native module not found"

Cause:
Running the app in Expo Go.

Fix:
Build a development client:

npx expo run:android
# or
npx expo run:ios

❌ Vibration not working on Android

  • Ensure the device is not in Silent / Do Not Disturb mode
  • Some OEMs disable vibration in silent mode
  • No manual permissions needed

The library automatically adds:

<uses-permission android:name="android.permission.VIBRATE" />

📄 License

MIT


Author: Vasanth S