🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-native-rich-vibration

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-rich-vibration

React Native Vibration Library with Rich Features

0.3.1
latest
Source
npm
Version published
Weekly downloads
6
-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Rich Vibration

This React Native library provides an alternative to the standard vibrations API, integrating haptic feedback for a more immersive user experience. With customizable options for intensity, duration, and sharpness, you have greater control over how vibrations feel in your application.

⚠️ This library requires your mobile device to have a haptic engine.

Installation

  • Install the module using npm or yarn:

    npx expo install react-native-rich-vibration
    

Demo

Watch the demo video below to see the React Native Rich Vibration module in action:

https://github.com/openingbracket/react-native-rich-vibration/assets/9054649/35f55ed6-f3b0-4d23-9d4d-74ae94693d42

Usage

import * as ReactNativeRichVibration from "react-native-rich-vibration";

// Check for Haptics Support
ReactNativeRichVibration.hasHaptics()

// Vibrate with Custom Duration and Intensity (Sharpness for iOS)
// For Android: vibrate(duration: number, intensity: number)
// For iOS: vibrate(duration: number, intensity: number, sharpness?: number)
ReactNativeRichVibration.vibrate(400, 50); // For Android
ReactNativeRichVibration.vibrate(400, 50, 40); // For iOS


// Cancel Ongoing Vibration
ReactNativeRichVibration.cancelVibration();

Keywords

react-native

FAQs

Package last updated on 10 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts