<div align="center">
npm install react-native-flip
``sh`
yarn add react-native-flipor
npm i react-native-flip
> :warning: You need to install react-native-reanimated and follow their installation instructions.
`js
import FlipCard from "react-native-flip"
const make = () => {
const Front = (
backgroundColor: "#ed8936",
alignItems: "center",
padding: 100,
borderRadius: 12,
}}
>
style={{
padding: 10,
marginTop: 20,
backgroundColor: "white",
borderRadius: 12,
}}
>
)
const Back = (
backgroundColor: "#007AFF",
alignItems: "center",
padding: 100,
borderRadius: 12,
}}
>
style={{
padding: 10,
marginTop: 20,
backgroundColor: "white",
borderRadius: 12,
}}
>
)
return (
title={Change rotation. The card rotation is: ${rotate}}
onPress={() => {
setRotate((rotation) => (rotation === "X" ? "Y" : "X"))
}}
/>
)
}
``
| Name | Description | Required | Type | Default |
| ----------- | --------------------------------------- | -------- | ------------- | ------- |
| perspective | Perspective of rotation | NO | Number | 1200 |
| side | A value indicating Front(1) or Back(0) | YES | <1, 0> | - |
| rotate | A value indicating the axis of rotation | NO | <'Y', 'X'> | "Y" |
| style | Container Style | NO | ViewStyle | - |
| front | React component in Front Side | YES | React.Element | - |
| back | React component in Back Side | YES | React.Element | - |
| iOS | Android |
|-----|---------|
|
|
|
You can also try out the example app with Expo.
You can also try the React Native App.
The source code for the example app is under /examples folder.