# react-native-side-menu **Repository Path**: zmzp/react-native-side-menu ## Basic Information - **Project Name**: react-native-side-menu - **Description**: No description available - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-06-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Customizable side menu for react-native

### Content - [Installation](#installation) - [Usage example](#usage-example) - [Component props](#component-props) - [Special thanks](#special-thanks) - [Questions?](#questions) ### Installation ```bash npm install react-native-side-menu ``` ### Usage example ```javascript var SideMenu = require('react-native-side-menu'); var ContentView = React.createClass({ render: function() { return ( Welcome to React Native! To get started, edit index.ios.js Press Cmd+R to reload,{'\n'} Cmd+Control+Z for dev menu ); } }); var Application = React.createClass({ render: function() { var menu = ; return ( ); } }); ``` Clicking on any menu item should cause closing menu. It can be done by using `menuActions` which are passed thru props to `menu` component. Example looks like this: ```javascript var Menu = React.createClass({ about: function() { this.props.menuActions.close(); this.props.navigator.push({...}); }, render: function() { return ( Menu About ); } }); ``` `menuActions` consists of following method(s): - `close` (Void) - Close menu - `toggle` (Void) - Toggle menu (close / open) - `open` (Void) - Open menu ### Component props - `menu` (React.Component) - Menu component - `animation` (spring|linear|easeInOut) - Type of slide animation. Default is "linear". - `openMenuOffset` (Number) - Content view left margin if menu is opened - `hiddenMenuOffset` (Number) - Content view left margin if menu is hidden - `toleranceX` (Number) - X axis tolerance - `toleranceY` (Number) - Y axis tolerance - `disableGestures` (Bool) - Disable whether the menu can be opened with gestures or not - `onChange` (Function) - Callback on menu open/close. Is passed `isOpen` as an argument. - `menuPosition` (String) - either 'left' or 'right', defaults to 'left' - `touchToClose` (Bool) - Allows for touching the partially hidden view to close the menu. Defaults to `false`. *In progress* ### Special thanks Creating this component has been inspired by [@khanghoang](https://github.com/khanghoang)'s [RNSideMenu](https://github.com/khanghoang/RNSideMenu) example. Also, thanks to [@ericvicenti](https://github.com/ericvicenti) for help with figuring out with `setNativeProps` ### Questions? Feel free to contact me in [twitter](https://twitter.com/kureevalexey) or [create an issue](https://github.com/Kureev/react-native-navbar/issues/new)