All Projects → Tinysymphony → React Native Drawer Menu

Tinysymphony / React Native Drawer Menu

Licence: mit
A drawer component for React Native Application.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Drawer Menu

Materialdrawerkt
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.
Stars: ✭ 508 (+262.86%)
Mutual labels:  drawer
Navigationviewfragmentadapters
A small library containing two adapters which allow for easy fragment management with a NavigationView.
Stars: ✭ 62 (-55.71%)
Mutual labels:  drawer
Jvfloatingdrawer
An easy to use floating drawer view controller.
Stars: ✭ 1,424 (+917.14%)
Mutual labels:  drawer
Fern.vim
🌿 General purpose asynchronous tree viewer written in Pure Vim script
Stars: ✭ 552 (+294.29%)
Mutual labels:  drawer
Duo Navigation Drawer
A flexible, easy to use, unique drawer library for your Android project.
Stars: ✭ 986 (+604.29%)
Mutual labels:  drawer
Xam.plugin.simplebottomdrawer
Just a nice and simple BottomDrawer for your Xamarin Forms project
Stars: ✭ 92 (-34.29%)
Mutual labels:  drawer
Drawer Behavior
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 394 (+181.43%)
Mutual labels:  drawer
Hyperion Android
App Debugging & Inspection Tool for Android
Stars: ✭ 1,778 (+1170%)
Mutual labels:  drawer
Treedrawer
treedrawer is a Go module for drawing trees on the terminal.
Stars: ✭ 43 (-69.29%)
Mutual labels:  drawer
Nativescript App Templates
Monorepo for NativeScript app templates
Stars: ✭ 108 (-22.86%)
Mutual labels:  drawer
Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (+351.43%)
Mutual labels:  drawer
Openlauncher
Customizable and Open Source Launcher for Android
Stars: ✭ 945 (+575%)
Mutual labels:  drawer
React Native Navigation Drawer Extension
Drawer API built on top of wix react-native-navigation for iOS and Android (with TypeScript!)
Stars: ✭ 98 (-30%)
Mutual labels:  drawer
Ngx Ui
🚀 Style and Component Library for Angular
Stars: ✭ 534 (+281.43%)
Mutual labels:  drawer
Drawer Behavior Flutter
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 110 (-21.43%)
Mutual labels:  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 (+194.29%)
Mutual labels:  drawer
Vue Drawer
vue.js drawer drawerlayout aside 侧边栏 抽屉
Stars: ✭ 81 (-42.14%)
Mutual labels:  drawer
Zimlx
Open Source and free launcher for Android
Stars: ✭ 137 (-2.14%)
Mutual labels:  drawer
Mp canvas drawer
🚀 微信小程序上canvas绘制图片助手,一个json就制作分享朋友圈图片
Stars: ✭ 1,611 (+1050.71%)
Mutual labels:  drawer
React Native Draggable View
DraggableView is a component for react-native, it allows you have a vertical draggable drawer view that you can drag up or drag down. So, if you drag and release that component, then it keeps moving until reach either initial position or container border.
Stars: ✭ 103 (-26.43%)
Mutual labels:  drawer

react-native-drawer-menu Build Status Coverage Status

A drawer component for React Native Application (ios / android)

Similar to drawer menu component of QQ mobile.

Examples

iOS Platform

Android Platform

Usage

SUGGESTION In iOS, the drawer menu component should only be used in the top level route, because the action that swipes from left side of the screen to right is designed to pop route from navigate stack. You are supposed to avoid the conflict of the UI interactions. At least, don't use the Left drawer menu to wrap sub routes, use Right drawer menu if it's needed.

install from npm

npm install --save react-native-drawer-menu

import in project

import Drawer from 'react-native-drawer-menu';
import {Easing} from 'react-native'; // Customize easing function (Optional)
// in render function
render() {
  // prepare your drawer content
  var drawerContent = (<View style={styles.drawerContent}>
    <View style={styles.leftTop}/>
    <View style={styles.leftBottom}>
      <View><Text>Drawer Content</Text></View>
    </View>
  </View>);
  // customize drawer's style (Optional)
  var customStyles = {
    drawer: {
      shadowColor: '#000',
      shadowOpacity: 0.4,
      shadowRadius: 10
    },
    mask: {}, // style of mask if it is enabled
    main: {} // style of main board
  };
  return (
    <Drawer
      style={styles.container}
      drawerWidth={300}
      drawerContent={drawerContent}
      type={Drawer.types.Overlay}
      customStyles={{drawer: styles.drawer}}
      drawerPosition={Drawer.positions.Right}
      onDrawerOpen={() => {console.log('Drawer is opened');}}
      onDrawerClose={() => {console.log('Drawer is closed')}}
      easingFunc={Easing.ease}
    >
      <View style={styles.content}>
        <Text>{Object.values(Drawer.positions).join(' ')}</Text>
        <Text>{Object.values(Drawer.types).join(' ')}</Text>
      </View>
    </Drawer>
  );
}

Notice: The reference of the drawer is passed to drawer content element, you could use this.props.drawer to invoke Drawer's instance methods like this.props.drawer.closeDrawer()

Properties

Property Type Default Description
disabled Bool false Disable the component or not.
leftDisabled Bool false Disable left drawer or not.
rightDisabled Bool false Disable right drawer or not.
type String ‘default' Type of the drawer. default / overlay You can also use static value Drawer.types.Default / Drawer.types.Overlay.
drawerPosition String ‘left' Determine where does the drawer come out. left / right / both You can also use static value Drawer.positions.Left / Drawer.positions.Right / Drawer.positions.Both.
drawerWidth Number 200 The width of drawer, it’s disabled when use replace type.
drawerContent React Component null The content of the drawer menu, default is left content.
leftDrawerContent React Component null The content of the left drawer menu.
rightDrawerContent React Component null The content of the right drawer menu.
duration Number 160 The duration of animation to open or close drawer.
maskAlpha Number 0.4 Maximum value is 0.5, the opactiy value of the mask over the main board when drawer is open. Mask can be disabled with showMask property.
showMask Bool true Whether show the mask when drawer is open.
customStyles Object {} Customize drawer styles. You can customize main / mask / drawer / leftDrawer / rightDrawer.
onDrawerOpen function null Triggers when drawer is totally opened.
onLeftDrawerOpen function null Triggers when the left drawer is totally opened.
onRightDrawerOpen function null Triggers when the right drawer is totally opened.
onDrawerClose function null Triggers when drawer is totally closed.
onLeftDrawerClose function null Triggers when the left drawer is totally closed.
onRightDrawerClose function null Triggers when the right drawer is totally closed.
startCapture Bool false Whether to capture touch events while clicking on screen.
moveCapture Bool false Whether to capture touch events while swiping over the screen.
easingFunc function null Easing function of drawer animation, default is Easing.linear. You can pass function like Easing.ease/Easing.bezier(x1, y1, x2, y2)/Easing.sin/Easing.elastic(times)/Easing.bounce etc.
responderNegotiate function null Customize conditions to set pan responder, evt & gestureState will be passed as arguments. Default condition is left 20% area on screen in left Drawer, or right 20% area on screen in right Drawer.

Instance methods

Use ref to invoke instance methods.

Method Description
openDrawer Open drawer manually
openLeftDrawer Open left drawer manually
openRightDrawer Open right drawer manually
closeDrawer Close drawer manually. The drawerContent has a ref of drawer instance, you can also trigger with it.
closeLeftDrawer Close left drawer manually
closeRightDrawer Close right drawer manually
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].