A Coverflow component for react-native.
$ npm install --save react-native-coverflow
or
$ yarn add react-native-coverflow
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import Coverflow from 'react-native-coverflow';
class YourComponent extends Component {
render() {
return (
<Coverflow onChange={(index) => console.log('Current item', index)}>
<View><Text>First Card</Text></View>
<View><Text>Second Card</Text></View>
<View><Text>Third Card</Text></View>
</Coverflow>
);
}
}
Checkout the demo project
https://github.com/Bhoos/coverflow-demo
$ git clone [email protected]:Bhoos/coverflow-demo.git
$ cd coverflow-demo
$ npm install
Run demo on iOS or Android
$ react-native run-ios
$ react-native run-android
A callback invoked whenever the selection changes.
A callback invoked when the central card is pressed.
The card that needs to be centered initially.
The number of pixels between the center card and the its adjacent card.
The number of pixels between the adjacent card and its next card.
The angle in degrees at which the non centered cards needs to be rotated.
The angle at which the center card needs to rotate to during transition. Use this value to make sure that during the central card transition, the cards do not overlap.
The perspective value for 3D projection. A lower value means viewing from a short distance.
A scale factor for the card adjacent to the center.
A diminising scale factor for the card next to the adjacent card.