New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-gesture-flip-card

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-gesture-flip-card

[![npm version](https://badge.fury.io/js/react-native-gesture-flip-card.svg)](https://badge.fury.io/js/react-native-gesture-flip-card)

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
124
decreased by-16.78%
Maintainers
0
Weekly downloads
 
Created
Source

react-native-gesture-flip-card

npm version

A pure javascript implementation of a flip card animation using gesture for React Native.

2024-11-10

  1. Create a new example app app and remove the old example
  2. (Breaking change) renderBack and renderFront are passing through props instenad of passing by children.
  3. (new) Add a argument in onFlipEnd function, it will return a boolean value(1: front and 0 for back) when the flip animation ended.
  4. (new) Add a new props: onFaceChanged function, it will retrun a boolean value(1: front and 0 for back) when the face is changed.

2022-03-16

  1. Update example to use react-native 0.67.3
  2. Use LogBox to ignore unnecessary warnings. (To use LogBox you need to upgrade react-native to at least 0.63 )

Installation

  npm install --save react-native-gesture-flip-card
  # or
  yarn add react-native-gesture-flip-card

Simple Preview

App preview App preview

Minimal Usage

import GestureFlipView from 'react-native-gesture-flip-card';
<View style={styles.container}>
  <GestureFlipView
    width={300}
    height={500}
    renderBack={renderBack}
    renderFront={renderFront}
    onFaceChanged={(face) => {
      // trigger when card face changed
      console.log('face changed:', face);
    }}
    onFlipEnd={(face) => {
      // trigger when flip animation ended
      console.log('on flip end:', face);
    }}
  />
</View>

const renderFront = () => {
  return (
    <View style={styles.frontStyle}>
      <Text style={{fontSize: 25, color: '#fff'}}>{'Front'}</Text>
    </View>
  );
};

const renderBack = () => {
  return (
    <View style={styles.backStyle}>
      <Text style={{fontSize: 25, color: '#fff'}}>{'Back'}</Text>
    </View>
  );
};

Detail

Props

Propstypedescriptionrequireddefault
widthnumberwidth of viewtrue
heightnumberheight of viewtrue
onFlipEndfunctioncallback on end of flipfalse
perspectivenumberperspective of the viewfalse-1000
gestureEnabledboolenable or disable gesturesfalsetrue
onFaceChangedfunctioncallback on face changedfalse

Method

namedescriptionargs
flipLeftflip the card counterclockwise
flipRightflip the card clockwise
<GestureFlipView
  ref={(ref) => (viewRef.current = ref)}
  {...} // skip showing other props
/>

// usage
viewRef.current.flipLeft();  // counterclockwise
viewRef.current.flipRight(); // clockwise

Keywords

FAQs

Package last updated on 10 Nov 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