Double-sided React component that flips 180 Degrees

Double-sided React component that flips 180 Degrees

Pass a boolean, front component, and back component as props. The boolean will determine if the front or back component should be displayed.Double-sided React component that flips 180 Degrees

react-native-flip-component

Installation

npm install react-native-flip-component --save

Instructions

Pass a boolean, front component, and back component as props. The boolean will determine if the front or back component should be displayed.

Demo

To see the code from this GIF, check out example.js in the repo on GitHub.

Props

Name Required? Description
isFlipped true Boolean that controls if the view is flipped.
frontView true Component for the front view.
backView true Component for the back view.
scale false Controls if the view zooms in or out while flipping. Defaults to 0.8
scaleDuration false Controls how quickly the scale changes. Defaults to 100
frontPerspective false Controls the perception of depth for the front component. Defaults to 1000
backPerspective false Controls the perception of depth for the back component. Defaults to 1000
rotateDuration false Controls the duration of the rotation. Defaults to 300
containerStyles false Styles for the flip-component's container <View>. Defaults to null
frontStyles false Styles for the <Animated.View> that wraps the front component. Defaults to null
backStyles false Styles for the <Animated.View> that wraps the back component. Defaults to null

Example

import React, { Component } from 'react';
import FlipComponent from 'react-native-flip-component';
import { View, Button, Text } from 'react-native';

class Example extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isFlipped: false;
    };
  }
  render() {
    <View>
      <FlipComponent
        isFlipped={this.state.isFlipped}
        frontView={
          <View>
            <Text style={{ textAlign: 'center' }}>
              Front Side
            </Text>
          </View>
        }
        backView={
          <View>
            <Text style={{ textAlign: 'center' }}>
              Back Side
            </Text>
          </View>
        }
      />
      <Button
        onPress={() => {
          this.setState({ isFlipped: !this.state.isFlipped })
        }}
        title="Flip"
      />
    </View>
  }
}

Download Details:

Author: plmok61

GitHub: https://github.com/plmok61/react-native-flip-component

react-native react mobile-apps

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Top React Native Mobile App Development Companies in New York

Looking for top React Native mobile app development company in USA for Startups & Enterprise? Find out the top list of React Native mobile app development company in USA.

React Native App Development Company in New York

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.

React Native App Development Company in New York

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.

Build a simple React Native Pokemon app with React-Navigation

As we start learning new technologies we want to start building something or work on a simple project to get a better understanding of the technology.

React Native aiding Android and iOS mobile app development

React Native allows app developers to build cross-platform mobile apps using same code for Android and iOS platforms.