# react-native-flip-view

> JavaScript implementation of a view container that can flip between its front and back

Latest version **1.0.5** (published 2016-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-flip-view
pnpm add react-native-flip-view
yarn add react-native-flip-view
bun add react-native-flip-view
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2016-08-10 |
| First published | 2015-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 112 |
| Author | Kevin Stumpf |
| Maintainers | dispatcher, kevinstumpf |
| Keywords | react-native, react-component, ios, android, flip, view, flipview |

## Links

- npm: https://www.npmjs.com/package/react-native-flip-view
- Repository: https://github.com/DispatcherInc/react-native-flip-view
- Homepage: https://github.com/DispatcherInc/react-native-flip-view#readme
- Issues: https://github.com/DispatcherInc/react-native-flip-view/issues
- npm.io page: https://npm.io/package/react-native-flip-view

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-08-10
- 1.0.4 — 2016-03-03
- 1.0.3 — 2015-12-23
- 1.0.2 — 2015-12-21
- 1.0.1 — 2015-12-20
- 1.0.0 — 2015-12-20

## README

# react-native-flip-view
JavaScript implementation of a view container that can flip between its front and back

## Demo

![flipviewdemo](https://cloud.githubusercontent.com/assets/7293984/11916918/14b36880-a6a3-11e5-84a3-dd88eca78b4d.gif)

## Installation

```sh
npm install react-native-flip-view
```

## Example

```js
var React = require('react-native');

var {
  View,
  Easing,
  TouchableOpacity,
  Text,
  Component,
  } = React;

var FlipView = require('react-native-flip-view');

export default class Demo extends Component {
  constructor(props) {
    super(props);
    this.state = { isFlipped: false };
  }

  render = () => {
    return (
      <FlipView style={{flex: 1}}
                front={this._renderFront()}
                back={this._renderBack()}
                isFlipped={this.state.isFlipped}
                onFlipped={(val) => {console.log('Flipped: ' + val);}}
                flipAxis="y"
                flipEasing={Easing.out(Easing.ease)}
                flipDuration={500}
                perspective={1000}/>
    );
  };

  _renderFront = () => {
    return (
      <View style={{flex: 1, backgroundColor: '#81D4FA', justifyContent: 'center', alignItems: 'center'}}>
        <TouchableOpacity style={{backgroundColor: 'black', padding: 20}} onPress={this._flip}>
          <Text style={{fontSize: 32, color: 'white'}}>Flip to Back!</Text>
        </TouchableOpacity>
      </View>
    );
  };

  _renderBack = () => {
    return (
      <View style={{flex: 1, backgroundColor: '#1565C0', justifyContent: 'center', alignItems: 'center'}}>
        <TouchableOpacity style={{backgroundColor: 'black', padding: 20}} onPress={this._flip}>
          <Text style={{fontSize: 32, color: 'white'}}>Flip to Front!</Text>
        </TouchableOpacity>
      </View>
    );
  };

  _flip = () => {
    this.setState({isFlipped: !this.state.isFlipped});
  };
}
```

.babelrc:
```js
{
  "retainLines": true,
  "whitelist": [
    "es6.arrowFunctions",
    "es6.blockScoping",
    "es6.classes",
    "es6.constants",
    "es6.destructuring",
    "es6.modules",
    "es6.parameters",
    "es6.properties.computed",
    "es6.properties.shorthand",
    "es6.spread",
    "es6.templateLiterals",
    "es7.asyncFunctions",
    "es7.trailingFunctionCommas",
    "es7.objectRestSpread",
    "es7.classProperties",
    "es7.decorators",
    "flow",
    "react",
    "react.displayName",
    "regenerator"
  ]
}
```

---
_Source: https://npm.io/package/react-native-flip-view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
