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-pro

v1.0.1

Published

High-performance bridge-less haptic feedback module for React Native built with Nitro Modules.

Readme

react-native-haptic-pro

A small, high-quality React Native library that exposes native haptic and vibration capabilities via Nitro Modules for iOS (Swift) and Android (Kotlin).

This README helps new users get started quickly, understand the public API, run the example app, and contribute.

Why use react-native-haptic-pro

  • Simple, focused API for common haptic patterns (impact, vibration, custom patterns).
  • Built with Nitro Modules for tight native integration on both iOS and Android.
  • Lightweight and easy to add to any React Native project.

Features

  • Trigger native impact haptics (light / medium / heavy).
  • Trigger simple vibration with a duration (ms).
  • Trigger custom vibration patterns (timings + amplitudes) on devices that support amplitude control.
  • Query whether the device supports amplitude control.

Installation

Install the library and the Nitro Modules runtime:

npm install react-native-haptic-pro react-native-nitro-modules

Notes:

  • react-native-nitro-modules is required: this project uses Nitro Modules to wire native implementations to JavaScript.
  • For React Native 0.60+ autolinking should pick up native modules. If you use CocoaPods, run pod install from the ios/ folder.

Quick start

Import the functions you need and call them directly:

import {
  triggerImpact,
  triggerVibrate,
  stopVibration,
  checkHardware,
  triggerPattern,
} from 'react-native-haptic-pro';

// Light impact
triggerImpact('light');

// Vibrate for 500ms
triggerVibrate(500);

// Stop ongoing vibration
stopVibration();

// Check for amplitude control
const hasAmp = checkHardware();

// Trigger a custom pattern (timings in ms, amplitudes 0-255)
if (hasAmp) {
  triggerPattern([0, 50, 100, 50], [0, 128, 255, 128]);
}

See the example/ folder for a working demo app.

API Reference

All functions are exported from the package root and call through to the native Nitro Hybrid object.

  • multiply(a: number, b: number): number

    • Utility/test method that returns a * b (handy for smoke tests).
  • triggerImpact(style: 'light' | 'medium' | 'heavy'): void

    • Trigger a platform-appropriate impact haptic.
  • triggerVibrate(duration: number): void

    • Start a vibration for duration milliseconds.
  • stopVibration(): void

    • Stop any ongoing vibration started by this module.
  • checkHardware(): boolean

    • Returns true if the device supports amplitude control (useful before calling triggerPattern).
  • triggerPattern(timings: number[], amplitudes: number[]): void

    • Triggers a custom vibration pattern. timings are durations in ms, amplitudes are 0-255 values on supported devices.

Types are included so TypeScript users get good autocompletion and compile-time checks.

Example app

This repository contains an example/ app that demonstrates typical usage. To run it:

  1. cd example
  2. npm install (or yarn)
  3. Run on device/simulator: npx react-native run-android or open the Xcode workspace for iOS.

Open example/src/App.tsx to see usage.

Compatibility

  • Platforms: iOS and Android
  • React Native: works with modern RN versions (0.60+). Older RN versions may require manual linking.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening PRs.

High-impact contribution ideas:

  • Add animated GIFs/screenshots showing the haptic effects.
  • Improve the example app and provide copy-paste snippets.
  • Add cross-platform tests and CI.
  • Curate good first issue and help wanted issues to attract contributors.

Tips to increase GitHub adoption

  • Add a short demo GIF at the top of the README.
  • Add topics to the GitHub repo: react-native, haptics, vibration.
  • Keep the example minimal and copy-paste friendly.
  • Write a short SHOWCASE.md with real-world use cases.

License

MIT — see the LICENSE file.

Credits

Built with Nitro Modules and the react-native-builder-bob scaffold.