# react-native-3dcube-navigation-reworked

> Reworked Edition of the original react-native-3dcube-navigation

Latest version **1.0.7** (published 2022-03-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-3dcube-navigation-reworked
pnpm add react-native-3dcube-navigation-reworked
yarn add react-native-3dcube-navigation-reworked
bun add react-native-3dcube-navigation-reworked
```

## 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.7 |
| Published | 2022-03-28 |
| First published | 2022-03-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ömer Ayhan |
| Maintainers | omerayhandev |
| Keywords | react-component, react-native, ios, android, react-navigation |

## Links

- npm: https://www.npmjs.com/package/react-native-3dcube-navigation-reworked
- Repository: https://github.com/omer-ayhan/react-native-3dcube-navigation-reworked
- Homepage: https://github.com/omer-ayhan/react-native-3dcube-navigation-reworked#readme
- Issues: https://github.com/omer-ayhan/react-native-3dcube-navigation-reworked/issues
- npm.io page: https://npm.io/package/react-native-3dcube-navigation-reworked

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^17.0.2

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.7 (latest) — 2022-03-28
- 1.0.6 — 2022-03-28

## README

<img src="img/logo.png" width="150px" />

# react-native-3dcube-navigation-reworked

<a href="https://www.npmjs.com/package/react-native-3dcube-navigation-reworked"><img src="https://img.shields.io/badge/1.0.7-%20npm-brightgreen" alt="NPM version"></a>

### Reworked Edition of the original [react-native-3dcube-navigation](https://github.com/zehfernandes/react-native-3dcube-navigation). Which mostly includes fixes

#

### Installation

##### With Yarn

```bash
$ yarn add react-native-3dcube-navigation-reworked
```

##### With NPM

```bash
$ npm i react-native-3dcube-navigation-reworked --save
```

### Demo

<img src="img/demo.gif"  />

### Basic Usage

##### Horizontal

```js
import { CubeNavigationHorizontal } from "react-native-3dcube-navigation-reworked";

<View style={styles.father}>
  <CubeNavigationHorizontal
    ref={(view) => {
      this.cube = view;
    }}>
    <View style={[styles.container, { backgroundColor: "#5CDB8B" }]}>
      <Text style={styles.text}>Horizontal Page 1</Text>
    </View>
    <View style={[styles.container, { backgroundColor: "#A3F989" }]}>
      <Text style={styles.text}>Horizontal Page 2</Text>
    </View>
    <View style={[styles.container, { backgroundColor: "#CBF941" }]}>
      <Text style={styles.text}>Horizontal Page 3</Text>
    </View>
  </CubeNavigationHorizontal>
</View>;
```

##### Vertical

```js
import { CubeNavigationVertical } from "react-native-3dcube-navigation-reworked";

<View style={styles.father}>
  <CubeNavigationVertical
    ref={(view) => {
      this.cube = view;
    }}>
    <View style={[styles.container, { backgroundColor: "#5CDB8B" }]}>
      <Text style={styles.text}>Vertical Page 1</Text>
    </View>
    <View style={[styles.container, { backgroundColor: "#A3F989" }]}>
      <Text style={styles.text}>Vertical Page 2</Text>
    </View>
    <View style={[styles.container, { backgroundColor: "#CBF941" }]}>
      <Text style={styles.text}>Vertical Page 3</Text>
    </View>
  </CubeNavigationVertical>
</View>;
```

### Properties

| Prop               | Default |    Type    | Description                                                                                                                           |
| :----------------- | :-----: | :--------: | :------------------------------------------------------------------------------------------------------------------------------------ |
| expandView         |  false  |   `bool`   | If `true`, the view expands not showing the background                                                                                |
| loop               |  false  |   `bool`   | If `true`, the last face will be allowed to scroll to the first                                                                       |
| scrollLockPage     |  null   |  `number`  | Lock swipe to the next pages, referring the index number of the page                                                                  |
| responderCaptureDx |   60    |  `number`  | The increment at which the responder captures the touch                                                                               |
| callBackAfterSwipe |  null   | `function` | Callback function after release                                                                                                       |
| callbackOnSwipe    |  null   | `function` | Callback function on start swipe & release, callback's first argument `started` defines if it's the start of the swipe or the release |

### Events

#### callBackAfterSwipe

| Name     |   Type   | Description           |
| :------- | :------: | :-------------------- |
| position | `number` | Position of the view. |
| index    | `number` | Index of the view     |

```js
callBackAfterSwipe = (position, index){

}

render(){
  return (
    <CubeNavigationHorizontal callBackAfterSwipe={this.callBackAfterSwipe}>
    </CubeNavigationHorizontal>
  );
}
```

### Methods

#### scrollTo(index, animated)

| Name     |   Type   |   default   | Description                     |
| :------- | :------: | :---------: | :------------------------------ |
| index    | `number` | `undefined` | Scroll to the page, start in 0. |
| animated |  `bool`  |   `true`    |                                 |

### Examples

```bash
$ cd examples
$ npm i
$ react-native run-ios
```

<br/>

> Inspired by [tlackemann](https://github.com/tlackemann/react-native-cube-transition) but implemented only with react-native libs.

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