Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-haptic-feedback

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-haptic-feedback

Basic haptic feedback for iOS and android

  • 2.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
167K
increased by6.84%
Maintainers
1
Weekly downloads
 
Created

What is react-native-haptic-feedback?

The react-native-haptic-feedback package provides a way to trigger haptic feedback (vibration) on iOS and Android devices. This can be used to enhance user experience by providing tactile feedback for various actions within a React Native application.

What are react-native-haptic-feedback's main functionalities?

Triggering Haptic Feedback

This feature allows you to trigger haptic feedback using the `trigger` method. The example demonstrates how to trigger a light impact haptic feedback when a button is pressed.

import React from 'react';
import { Button, View } from 'react-native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';

const App = () => {
  const triggerHapticFeedback = () => {
    const options = {
      enableVibrateFallback: true,
      ignoreAndroidSystemSettings: false
    };
    ReactNativeHapticFeedback.trigger('impactLight', options);
  };

  return (
    <View>
      <Button title="Trigger Haptic Feedback" onPress={triggerHapticFeedback} />
    </View>
  );
};

export default App;

Customizing Haptic Feedback

This feature allows you to customize the type of haptic feedback. The example shows how to trigger a 'notificationSuccess' haptic feedback, which can be used to indicate a successful action.

import React from 'react';
import { Button, View } from 'react-native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';

const App = () => {
  const triggerCustomHapticFeedback = () => {
    const options = {
      enableVibrateFallback: true,
      ignoreAndroidSystemSettings: false
    };
    ReactNativeHapticFeedback.trigger('notificationSuccess', options);
  };

  return (
    <View>
      <Button title="Trigger Custom Haptic Feedback" onPress={triggerCustomHapticFeedback} />
    </View>
  );
};

export default App;

Other packages similar to react-native-haptic-feedback

Keywords

FAQs

Package last updated on 18 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc