Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/tlackemann/react-native-cube-transition

React Native module for iOS that rotates components on a cube, similar to Instagram Stories.
https://github.com/tlackemann/react-native-cube-transition

Last synced: about 2 months ago
JSON representation

React Native module for iOS that rotates components on a cube, similar to Instagram Stories.

Lists

README

        

# React Native Cube Transition

React Native module for iOS that rotates components on a cube, similar to Instagram Stories.

![](https://thumbs.gfycat.com/EachFirmImperatorangel-size_restricted.gif)

## Installation

Install the module from npm.

```bash
npm install react-native-cube-transition --save
```

### iOS

Link the framework in XCode.

* Right click _Libraries_
* Add Files to _[Your Project's Name]_
* Go to `node_modules/react-native-cube-transition`
* Add the `.xcodeproj` file
* Add the `libRNCubeTransition.a` file under `Libraries > RNCubeTransition.xcodeproj > Products` to your project's `Build Phases > Link Binary With Libraries`

### Android

Not supported, yet.

## Usage

```javascript
import React, { Component } from 'react';
import { Image, Dimensions, Text, StyleSheet, View } from 'react-native';
import { RNCubeTransition } from 'react-native-cube-transition';

export default class MyComponent extends Component {
render() {
return (



3D Cube Transitions Using React Native



Use View or Image components



Even Gifs




);
}
}

const { width, height } = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
flex: 1,
},
page: {
position: 'absolute',
flexDirection: 'row',
overflow: 'hidden',
top: 0,
bottom: 0,
left: 0,
right: 0,
},
image: {
resizeMode: 'stretch',
width,
height,
},
view: {
justifyContent: 'center',
alignItems: 'center',
width,
height,
},
text: {
color: '#FFF',
textAlign: 'center',
fontSize: 30,
},
});
```

## License

MIT