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-nitro-haptic

v0.1.5

Published

React Native nitro feedback with customization

Readme

react-native-nitro-haptic

Lightweight, fast haptics for React Native powered by Nitro Modules. Supports simple presets and fully custom haptic patterns on iOS and Android.

Disclaimer

This library was primarily generated by ChatGPT. The author does not know C++, Kotlin, or Swift. Use at your own risk; reviews and contributions are welcome.

Installation

Install the library and Nitro Modules:

npm i react-native-nitro-haptic react-native-nitro-modules
# or
bun add react-native-nitro-haptic react-native-nitro-modules
# or
yarn add react-native-nitro-haptic react-native-nitro-modules

iOS pods:

npx pod-install

Then rebuild your app.

Notes

  • Android vibrate permission is included by the library manifest
  • iOS Core Haptics custom patterns require iOS 13+; presets work on older iOS via UIKit feedback generators

Quick start

Trigger a preset or play a custom pattern

import { notify, play } from 'react-native-nitro-haptic'

notify('selection')

play({
  events: [
    { eventType: 'hapticTransient', time: 0, parameters: { intensity: 1, sharpness: 0.6 } },
    { eventType: 'hapticTransient', time: 0.2, parameters: { intensity: 0.8, sharpness: 0.3 } }
  ]
})

Check availability

import { NitroHaptic } from 'react-native-nitro-haptic'

if (NitroHaptic.isAvailable()) {
  notify('impactMedium')
}

Presets

Available HapticPreset values

'selection' | 'impactLight' | 'impactMedium' | 'impactHeavy' | 'impactSoft' | 'impactRigid' | 'notificationSuccess' | 'notificationWarning' | 'notificationError'

API

| Name | Type | Description | | --- | --- | --- | | notify | (preset: HapticPreset) => void | Triggers a one-shot preset. Cross‑platform. | | play | (pattern: HapticPattern) => Promise | Plays a custom haptic pattern. On iOS uses Core Haptics; on Android approximates with waveform. | | NitroHaptic | Haptic | The underlying Nitro hybrid object exposing isAvailable, notify, play. | | HapticPreset | union | See Presets list above. | | HapticPattern | { events: HapticEvent[] } | Pattern container. | | HapticEvent | { eventType, time, eventDuration?, parameters? } | Single event within a pattern. | | HapticEventType | 'hapticTransient' | 'hapticContinuous' | Event kind: transient tap or continuous buzz. | | HapticParameters | { intensity?: number; sharpness?: number } | Both in [0..1]. |

Event fields

  • eventType: 'hapticTransient' or 'hapticContinuous'
  • time: seconds from pattern start (number)
  • eventDuration: duration in seconds for continuous events
  • parameters.intensity: 0..1 amplitude
  • parameters.sharpness: 0..1 brightness (iOS); used to shape transient length on Android

Custom pattern examples

Heartbeat

import { play } from 'react-native-nitro-haptic'

play({
  events: [
    { eventType: 'hapticTransient', time: 0, parameters: { intensity: 0.8, sharpness: 0.2 } },
    { eventType: 'hapticTransient', time: 0.2, parameters: { intensity: 1, sharpness: 0.3 } }
  ]
})

Crescendo

play({
  events: Array.from({ length: 8 }).map((_, i) => ({
    eventType: 'hapticTransient' as const,
    time: i * 0.06,
    parameters: { intensity: Math.min(0.2 + i * 0.1, 1), sharpness: 0.3 + i * 0.05 }
  }))
})

Migrating from react-native-haptic-feedback

Use the helper map to keep familiar names

import { RNHFPresetToNitro, notify } from 'react-native-nitro-haptic'

notify(RNHFPresetToNitro.rigid)
notify(RNHFPresetToNitro.notificationSuccess)

Platform notes

  • iOS: Presets are backed by UI*FeedbackGenerator. Custom patterns use Core Haptics and require a device with haptics (iOS 13+). On devices without Core Haptics, play resolves without producing haptics.
  • Android: Presets and patterns use Vibrator/VibrationEffect. On API < 26, patterns degrade to a single vibration; on API 26+, waveforms with custom amplitudes are used.

Example app

See example for a runnable showcase with multiple presets and patterns.

Contributing

License

MIT

Made with create-react-native-library