• Stars
    star
    282
  • Rank 146,549 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

react-native-3dcube-navigation

Installation

With Yarn
$ yarn add react-native-3dcube-navigation
With NPM
$ npm i react-native-3dcube-navigation --save

Demo

Basic Usage

Horizontal
import { CubeNavigationHorizontal } from 'react-native-3dcube-navigation'

<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
import { CubeNavigationVertical } from 'react-native-3dcube-navigation'

<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
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

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

Inspired by tlackemann but implemented only with react-native libs.

More Repositories

1

pliim

One click and be ready to go up on stage and shine!
JavaScript
669
star
2

wordnote

A simple and elegant notebook to write new words and discover their meanings and synonyms https://wordnote.app
JavaScript
655
star
3

jquery.fullContent

Enables fully websites
HTML
220
star
4

rpi-webapplication

Text Guide and snippets to have 60fps web application using Raspberry
Shell
141
star
5

worldcup2018-posters

abstract patterns with canvas and world cup statistics
JavaScript
134
star
6

get-vercel-source-code

Get source code hosted at vercel
JavaScript
96
star
7

boldo

A reactive open source prototype tool
JavaScript
88
star
8

gifline

The fast way to put gif in or emails
JavaScript
66
star
9

screeener

Insert a bunch of images to keynote magically. πŸ’«
JavaScript
62
star
10

dailylog

none of your business
53
star
11

sketch-pochette

A Sketch plugin that lets you carry your most used properties close to your mouse.
JavaScript
48
star
12

brazilianswhodesign

is a place to showcase the work of talented Brazilian designers to the world.
JavaScript
45
star
13

jQuery.DebugCssAnimation

jQuery plugin to Debug quickly CSS animations
JavaScript
44
star
14

twitter-following-map-obsidian

JavaScript
18
star
15

framer-loadingplaceholder

Instantly creates Loading placeholder based on your layer style.
CoffeeScript
16
star
16

awesome-code-sketches

A curated list of artists's coding sketches.
16
star
17

framerx-cookbook

Important Framer X tips and workflows
10
star
18

wordcup2023-posters

Combining generative art, football and graphic design
JavaScript
6
star
19

sketch-create-inventory

JavaScript
3
star
20

figma-enumerator

HTML
2
star
21

gourmetstrike

HTML
2
star
22

twitter-bookmark-to-like

A browser extension to modify twitter navigation to replace the bookmarks with likes.
CSS
2
star
23

worldcup2019-posters

Experiment with game stats and abstract patterns
JavaScript
2
star
24

adventofcode2018

JavaScript
1
star
25

framer-autoflow

1
star