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

react-native-swipe-gestures

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-swipe-gestures

4-directional swipe gestures for react-native

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is react-native-swipe-gestures?

The react-native-swipe-gestures package allows developers to easily add swipe gesture recognition to their React Native applications. It supports swipe gestures in four directions: up, down, left, and right, and provides a simple API to handle these gestures.

What are react-native-swipe-gestures's main functionalities?

Swipe Left Gesture

This feature allows you to detect a left swipe gesture. The onSwipeLeft function is called whenever a left swipe is detected.

import React from 'react';
import { View, Text } from 'react-native';
import GestureRecognizer from 'react-native-swipe-gestures';

const App = () => {
  const onSwipeLeft = (gestureState) => {
    console.log('Swiped left!');
  };

  return (
    <GestureRecognizer
      onSwipeLeft={onSwipeLeft}
      style={{ flex: 1 }}
    >
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text>Swipe left to see the action in console</Text>
      </View>
    </GestureRecognizer>
  );
};

export default App;

Swipe Right Gesture

This feature allows you to detect a right swipe gesture. The onSwipeRight function is called whenever a right swipe is detected.

import React from 'react';
import { View, Text } from 'react-native';
import GestureRecognizer from 'react-native-swipe-gestures';

const App = () => {
  const onSwipeRight = (gestureState) => {
    console.log('Swiped right!');
  };

  return (
    <GestureRecognizer
      onSwipeRight={onSwipeRight}
      style={{ flex: 1 }}
    >
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text>Swipe right to see the action in console</Text>
      </View>
    </GestureRecognizer>
  );
};

export default App;

Swipe Up Gesture

This feature allows you to detect an upward swipe gesture. The onSwipeUp function is called whenever an upward swipe is detected.

import React from 'react';
import { View, Text } from 'react-native';
import GestureRecognizer from 'react-native-swipe-gestures';

const App = () => {
  const onSwipeUp = (gestureState) => {
    console.log('Swiped up!');
  };

  return (
    <GestureRecognizer
      onSwipeUp={onSwipeUp}
      style={{ flex: 1 }}
    >
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text>Swipe up to see the action in console</Text>
      </View>
    </GestureRecognizer>
  );
};

export default App;

Swipe Down Gesture

This feature allows you to detect a downward swipe gesture. The onSwipeDown function is called whenever a downward swipe is detected.

import React from 'react';
import { View, Text } from 'react-native';
import GestureRecognizer from 'react-native-swipe-gestures';

const App = () => {
  const onSwipeDown = (gestureState) => {
    console.log('Swiped down!');
  };

  return (
    <GestureRecognizer
      onSwipeDown={onSwipeDown}
      style={{ flex: 1 }}
    >
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text>Swipe down to see the action in console</Text>
      </View>
    </GestureRecognizer>
  );
};

export default App;

Other packages similar to react-native-swipe-gestures

Keywords

FAQs

Package last updated on 21 Mar 2020

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