All Projects → aspect-apps → React Native Navigation Drawer Extension

aspect-apps / React Native Navigation Drawer Extension

Drawer API built on top of wix react-native-navigation for iOS and Android (with TypeScript!)

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to React Native Navigation Drawer Extension

react-native-navigation-drawer-extension
Drawer API built on top of wix react-native-navigation for iOS and Android (with TypeScript!)
Stars: ✭ 151 (+54.08%)
Mutual labels:  native, navigation, drawer
Xam.plugin.simplebottomdrawer
Just a nice and simple BottomDrawer for your Xamarin Forms project
Stars: ✭ 92 (-6.12%)
Mutual labels:  navigation, drawer
Gta V Data Dumps
GTA V Data dumps useful for modding & scripting
Stars: ✭ 148 (+51.02%)
Mutual labels:  navigation, native
Jvfloatingdrawer
An easy to use floating drawer view controller.
Stars: ✭ 1,424 (+1353.06%)
Mutual labels:  navigation, drawer
react-native-navigation-drawer-layout
React Native library to generate navigation drawer layout.
Stars: ✭ 26 (-73.47%)
Mutual labels:  navigation, drawer
Mmenu Js
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
Stars: ✭ 2,535 (+2486.73%)
Mutual labels:  navigation, drawer
Nativescript App Templates
Monorepo for NativeScript app templates
Stars: ✭ 108 (+10.2%)
Mutual labels:  navigation, drawer
hipsbarjs
Hipsbarjs is a javascript plugin for easily creating drawers in web apps
Stars: ✭ 17 (-82.65%)
Mutual labels:  navigation, drawer
drawer-with-bottom-navigation-architecture
Sample android kotlin project with both drawer and bottom navigation together
Stars: ✭ 42 (-57.14%)
Mutual labels:  navigation, drawer
React Native Actions Sheet
A Cross Platform(Android & iOS) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
Stars: ✭ 412 (+320.41%)
Mutual labels:  native, drawer
React Native Circle Button
A Customizable React Native Circle Button
Stars: ✭ 87 (-11.22%)
Mutual labels:  native
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (-11.22%)
Mutual labels:  native
Cipher.so
A simple way to encrypt your secure data like passwords into a native .so library.
Stars: ✭ 1,308 (+1234.69%)
Mutual labels:  native
Slidingtabbar
A custom TabBar view with sliding animation written in Swift.
Stars: ✭ 84 (-14.29%)
Mutual labels:  navigation
Modo
Navigation library based on UDF principles
Stars: ✭ 85 (-13.27%)
Mutual labels:  navigation
Facebook ssl pinning
Bypassing SSL Pinning in Facebook Android App
Stars: ✭ 95 (-3.06%)
Mutual labels:  native
Navigation
ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
Stars: ✭ 1,248 (+1173.47%)
Mutual labels:  navigation
Karte
🗺 Conveniently launch directions in other iOS apps
Stars: ✭ 83 (-15.31%)
Mutual labels:  navigation
Rvo2 Unity
use rvo2 (Optimal Reciprocal Collision Avoidance) in unity.
Stars: ✭ 97 (-1.02%)
Mutual labels:  navigation
Cleanarchitecture
Android Kotlin Clean Architecture
Stars: ✭ 94 (-4.08%)
Mutual labels:  navigation


React Native Navigation Drawer Extension

version license downloads

React Native Navigation by Wix does not offer an in-built solution for displaying a drawer on iOS. Their current side-menu has limited functionality on both iOS and Android. This is a drawer solution using showOverlay under the hood to display a drawer on iOS and Android.

If you are using React Native Navigation >= 3.0.0 then use version 3.x.x + of this library.

Install

 npm install react-native-navigation-drawer-extension --save

or

 yarn add react-native-navigation-drawer-extension

Usage

You need to register your drawer component with RNN. To do this use the register method and wrap your component in the RNNDrawer HOC.

import { Navigation } from "react-native-navigation";
import { RNNDrawer } from "react-native-navigation-drawer-extension";

// register our drawer component with RNN
Navigation.registerComponent("CustomDrawer", () => RNNDrawer.create(CustomDrawer));

You can then use the drawer by calling a custom method. The showDrawer method will take a single parameter options identical to showOverlay.

import { RNNDrawer } from "react-native-navigation-drawer-extension";

RNNDrawer.showDrawer({
  component: {
    name: "CustomDrawer",
    passProps: {
      animationOpenTime: 300,
      animationCloseTime: 300,
      direction: "left",
      dismissWhenTouchOutside: true,
      fadeOpacity: 0.6,
      drawerScreenWidth: "75%" || 445, // Use relative to screen '%' or absolute
      drawerScreenHeight: "100%" || 700,
      style: { // Styles the drawer container, supports any react-native style
        backgroundColor: "red",
      },
      parentComponentId: props.componentId, // Custom prop, will be available in your custom drawer component props
    },
  }
});

RNNDrawer.dismissDrawer();

To navigate from the drawer you must pass the parent componentId and use that to navigate. e.g:

// From drawer component
Navigation.push(parentComponentId, {
  component: {
    name: "CustomScreenFromDrawer",
  },
});

There's a complete and functional example at the example folder, with more thorough explanation on each method.

Props

The props below are used to configure the drawer and are to be used in RNN passProps:. Any aditional props will be passed to your custom drawer component.

Prop Type Optional Default Description
animationOpenTime float Yes 300 Time in milliseconds to execute the drawer opening animation.
animationCloseTime float Yes 300 Time in milliseconds to execute the drawer closing animation.
direction string Yes left Direction to open the collage, one of: ["left", "right", "top", "bottom"].
dismissWhenTouchOutside bool Yes true Should the drawer be dismissed when a click is registered outside?
fadeOpacity number Yes 0.6 Opacity of the screen outside the drawer.
drawerScreenWidth number Yes 0.8 0 - 1, width of drawer in relation to the screen.
drawerScreenHeight number Yes 1 0 - 1, height of drawer in relation to the screen.

SideMenuView

The library also exposes a component which will allow you to open the drawer by either swiping the left or right gutter of the phone. This is achieved by using event listeners to communicate with the RNNDrawer HOC component. To enable this feature wrap your screen with the SideMenuView component. <SideMenuView> is just an enhanced <View> all props are passed down to <View>.

import { SideMenuView } from "react-native-navigation-drawer-extension";

<SideMenuView
  style={{ flex: 1 }}
  drawerName={'CustomDrawer'}
  direction={'right'}
  passProps={{
    animationOpenTime: 300,
    animationCloseTime: 300,
    dismissWhenTouchOutside: true,
    fadeOpacity: 0.6,
    drawerScreenWidth: '75%',
    drawerScreenHeight: '100%',
    parentComponentId: props.componentId,
    style: {
      backgroundColor: 'white', 
    },
  }}
  options={{
    layout: {
      componentBackgroundColor: 'transparent',
    }
 >
  {...}
 </SideMenuView>

Props

Prop Type Optional Default Description
style StyleProp Yes The style of the drawer container.
drawerName string No The name of the drawer component.
direction string Yes left The direction to open the drawer, one of: ["left", "right"].
passProps object Yes The values passed to the drawer. See props in RNNDrawer above.
options Options Yes The options to configure properties of the React Native Navigation native screen. Refer to React Native Navigation's options object.
swipeSensitivity number Yes 0.2 The sensitivity of the swipe to invoke each function.
sideMargin number Yes 15 The size of the gutter for both sides.
sideMarginLeft number Yes The size of the gutter for the left side.
sideMarginRight number Yes The size of the gutter for the right side.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].