0.0.4 • Published 2 years ago

vindicce-coverflow-react-native v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

yarn add vindicce-coverflow-react-native

Usage

Here is a quick example, using the default CoverFlow.

import React from 'react';
import { View } from 'react-native';
import CoverFlow from 'vindicce-coverflow-react-native';

export const App = () => {

  return (
    <View style={{flex: 1}}>
      <CoverFlow
        style={{ flex: 1 }}
        onChange={() => alert("onChange")}
        onPress={() => alert("onPress")}
        spacing={100}
        midRotation={0}
        scaleDown={0.8}
        scaleFurther={0.75}
        perspective={800}>
        <View style={{width: 120, height: 80, backgroundColor: "purple"}} />
        <View style={{width: 120, height: 80, backgroundColor: "red"}} />
        <View style={{width: 120, height: 80, backgroundColor: "blue"}} />
      </CoverFlow>
    </>
  );
};

Props

Props Nametypedescription
onChange :callback(index)() => numberA callback invoked whenever the selection changes.
onPress :callback(index)() => numberA callback invoked when the central card is pressed.
initialSelectionnumber:default 0The card that needs to be centered initially.
spacingnumber:default 100The number of pixels between the center card and the its adjacent card.
wingSpannumber:default 0The number of pixels between the adjacent card and its next card.
rotationnumber:default 0The angle in degrees at which the non centered cards needs to be rotated.
midRotationnumber:default 50The 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.
perspectivenumber:default 800The perspective value for 3D projection. A lower value means viewing from a short distance.
scaleDownnumber:default 0.8A scale factor for the card adjacent to the center.
scaleFurthernumber:default 0.75A diminising scale factor for the card next to the adjacent card.
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago