# react-native-side-menu **Repository Path**: mirrors_gorangajic/react-native-side-menu ## Basic Information - **Project Name**: react-native-side-menu - **Description**: Simple customizable component to create side menu - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-05-23 ## 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 - `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 - `onStartShouldSetResponderCapture` (Function) - Function that accepts event as an argument and specify if side-menu should react on the touch or not. Check https://facebook.github.io/react-native/docs/gesture-responder-system.html for more details. - `onChange` (Function) - Callback on menu open/close. Is passed `isOpen` as an argument - `menuPosition` (String) - either 'left' or 'right', defaults to 'left' - `animationFunction` (Function -> Object) - Function that accept 2 arguments (prop, value) and return an object: - `prop` you should use at the place you specify parameter to animate; - `value` you should use to specify the final value of `prop`; - `animationStyle` (Function -> Object) - Function that accept 1 argument (value) and return an object: - `value` you should use at the place you need current value of animated parameter (left offset of content view) - `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-side-menu/issues/new)