{"id":16811032,"url":"https://github.com/lukebrandonfarrell/react-native-navigation-drawer-extension","last_synced_at":"2025-04-09T19:19:31.083Z","repository":{"id":34199057,"uuid":"171316468","full_name":"lukebrandonfarrell/react-native-navigation-drawer-extension","owner":"lukebrandonfarrell","description":"Drawer API built on top of wix react-native-navigation for iOS and Android (with TypeScript!)","archived":false,"fork":false,"pushed_at":"2023-03-05T15:50:32.000Z","size":2038,"stargazers_count":211,"open_issues_count":28,"forks_count":31,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-09T19:19:25.939Z","etag":null,"topics":["android","drawer","ios","native","navigation","react-native","react-native-navigation","side-menu","typescript","typescript-library","wix"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukebrandonfarrell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-18T16:19:52.000Z","updated_at":"2025-03-28T13:58:57.000Z","dependencies_parsed_at":"2024-06-19T06:11:45.059Z","dependency_job_id":"2e3d3826-8297-438f-9059-c392316f6891","html_url":"https://github.com/lukebrandonfarrell/react-native-navigation-drawer-extension","commit_stats":{"total_commits":106,"total_committers":13,"mean_commits":8.153846153846153,"dds":0.4339622641509434,"last_synced_commit":"f705aca041a652aa45daf08c631bc197e11f0f41"},"previous_names":["lukebrandonfarrell/wix-react-native-navigation-drawer"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrandonfarrell%2Freact-native-navigation-drawer-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrandonfarrell%2Freact-native-navigation-drawer-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrandonfarrell%2Freact-native-navigation-drawer-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrandonfarrell%2Freact-native-navigation-drawer-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukebrandonfarrell","download_url":"https://codeload.github.com/lukebrandonfarrell/react-native-navigation-drawer-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094991,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","drawer","ios","native","navigation","react-native","react-native-navigation","side-menu","typescript","typescript-library","wix"],"created_at":"2024-10-13T10:17:26.559Z","updated_at":"2025-04-09T19:19:31.060Z","avatar_url":"https://github.com/lukebrandonfarrell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/7014073/98849326-cca07f80-2431-11eb-82dd-fd2b4e52be44.png?s=300\" width=\"325\" /\u003e\u003cbr/\u003e\n  React Native Navigation Drawer Extension\n\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"version\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\"\u003e\n  \u003cimg src=\"http://img.shields.io/npm/l/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"license\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"http://img.shields.io/npm/dt/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"downloads\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square\" alt=\"contributors\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\u003c/p\u003e\n\n[React Native Navigation by Wix](https://wix.github.io/react-native-navigation/#/) 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.\n\nIf you are using React Native Navigation \u003e= 3.0.0 then use version 3.x.x + of this library.\n\n\u003cimg align=\"left\" src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/left-drawer.gif\" width=\"48%\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/bottom-drawer.gif\" width=\"48%\" /\u003e\n\n## Install\n\n```sh\n npm install react-native-navigation-drawer-extension --save\n```\n\nor\n\n```sh\n yarn add react-native-navigation-drawer-extension\n```\n\n## Usage\n\nYou need to register your drawer component with RNN. To do this use the register method and wrap your component in the RNNDrawer HOC.\n\n```js\nimport { Navigation } from \"react-native-navigation\";\nimport { RNNDrawer } from \"react-native-navigation-drawer-extension\";\n\n// register our drawer component with RNN\nNavigation.registerComponent(\"CustomDrawer\", () =\u003e RNNDrawer.create(CustomDrawer));\n```\n\nYou can then use the drawer by calling a custom method. The `showDrawer` method\nwill take a single parameter `options` identical to `showOverlay`.\n\n````js\nimport { RNNDrawer } from \"react-native-navigation-drawer-extension\";\n\nRNNDrawer.showDrawer({\n  component: {\n    name: \"CustomDrawer\",\n    passProps: {\n      animationOpenTime: 300,\n      animationCloseTime: 300,\n      direction: \"left\",\n      dismissWhenTouchOutside: true,\n      fadeOpacity: 0.6,\n      drawerScreenWidth: \"75%\" || 445, // Use relative to screen '%' or absolute\n      drawerScreenHeight: \"100%\" || 700,\n      style: { // Styles the drawer container, supports any react-native style\n        backgroundColor: \"red\",\n      },\n      parentComponentId: props.componentId, // Custom prop, will be available in your custom drawer component props\n    },\n  }\n});\n\nRNNDrawer.dismissDrawer();\n````\n\nTo navigate from the drawer you must pass the parent `componentId` and use that to navigate. e.g:\n\n```js\n// From drawer component\nNavigation.push(parentComponentId, {\n  component: {\n    name: \"CustomScreenFromDrawer\",\n  },\n});\n```\n\nThere's a complete and functional example at the `example` folder, with more thorough explanation on each method.\n\n#### Props\n\nThe props below are used to configure the drawer and are to be used in RNN `passProps:`. Any aditional\nprops will be passed to your custom drawer component.\n\n| Prop                         | Type          | Optional | Default | Description                                                                                                                          |\n| ---------------------------- | ------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| animationOpenTime            | float         | Yes      | 300     | Time in milliseconds to execute the drawer opening animation.                                                                        |\n| animationCloseTime           | float         | Yes      | 300     | Time in milliseconds to execute the drawer closing animation.                                                                        |\n| direction                    | string        | Yes      | left    | Direction to open the collage, one of: [\"left\", \"right\", \"top\", \"bottom\"].                                                           |\n| dismissWhenTouchOutside      | bool          | Yes      | true    | Should the drawer be dismissed when a click is registered outside?                                                                   |\n| fadeOpacity                  | number        | Yes      | 0.6     | Opacity of the screen outside the drawer.                                                                                            |\n| drawerScreenWidth            | number/string | Yes      | 80%     | Width of drawer on portrait orientation. Pass a string containing '%' (e.g. \"80%\") for setting the width in relation to the screen or a number for absolute width (e.g. 300)  |\n| drawerScreenWidthOnLandscape | number/string | Yes      | 30%     | Width of drawer on landscape orientation. Pass a string containing '%' (e.g. \"80%\") for setting the width in relation to the screen or a number for absolute width (e.g. 300) |\n| drawerScreenHeight           | number/string | Yes      | 100%    | Height of drawer. Pass a string containing '%' (e.g. \"30%\") for setting the height in relation to the screen or a number for absolute height (e.g. 300)\n| disableDragging              | boolean       | Yes       | false   | Whether you want to disable dragging of the drawer. Useful if you have ScrollView inside the drawer (addresses #62).|\n| disableSwiping               | boolean       | Yes       | false   | Whether you want to disable swiping gesture. Use it only in pair with disableDragging.  |\n\n## SideMenuView\n\n\u003cimg src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/slide-drawer.gif\" width=\"30%\" /\u003e\n\nThe 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\nto communicate with the RNNDrawer HOC component. To enable this feature wrap your screen with the `SideMenuView` component. `\u003cSideMenuView\u003e` is just an enhanced `\u003cView\u003e` all props are passed down to `\u003cView\u003e`.\n\n```js\nimport { SideMenuView } from \"react-native-navigation-drawer-extension\";\n\n\u003cSideMenuView\n  style={{ flex: 1 }}\n  drawerName={'CustomDrawer'}\n  direction={'right'}\n  passProps={{\n    animationOpenTime: 300,\n    animationCloseTime: 300,\n    dismissWhenTouchOutside: true,\n    fadeOpacity: 0.6,\n    drawerScreenWidth: '75%',\n    drawerScreenHeight: '100%',\n    parentComponentId: props.componentId,\n    style: {\n      backgroundColor: 'white', \n    },\n  }}\n  options={{\n    layout: {\n      componentBackgroundColor: 'transparent',\n    }\n \u003e\n  {...}\n \u003c/SideMenuView\u003e\n\n```\n\n#### Props\n\n| Prop                | Type          | Optional  | Default | Description                                                                             |\n| ------------------- | ------------- | --------- | ------- | --------------------------------------------------------------------------------------- |\n| style               | StyleProp\u003cViewStyle\u003e | Yes |        | The style of the drawer container.                              |\n| drawerName          | string        | No        |         | The name of the drawer component.\n| direction           | string        | Yes       | left    | The direction to open the drawer, one of: [\"left\", \"right\"].\n| passProps           | object        | Yes       |         | The values passed to the drawer. See props in RNNDrawer above.\n| options             | Options       | Yes       |         | The options to configure properties of the React Native Navigation native screen. Refer to React Native Navigation's options object.\n| swipeSensitivity    | number        | Yes       | 0.2     | The sensitivity of the swipe to invoke each function.                                   |\n| sideMargin          | number        | Yes       | 15      | The size of the gutter for both sides.                                                  |\n| sideMarginLeft      | number        | Yes       |         | The size of the gutter for the left side.                                               |\n| sideMarginRight     | number        | Yes       |         | The size of the gutter for the right side.                                              |   \n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Danite\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/9094825?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniil Merkulov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=Danite\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=Danite\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/rodriigovieira\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7014073?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRodrigo Vieira\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=rodriigovieira\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/issues?q=author%3Arodriigovieira\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=rodriigovieira\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#maintenance-rodriigovieira\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://discord.gg/QqTN6HqNTG\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/18139277?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLuke Brandon Farrell\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=lukebrandonfarrell\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/issues?q=author%3Alukebrandonfarrell\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=lukebrandonfarrell\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/CursedWizard\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/67508707?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCyberFuntik\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=CursedWizard\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=CursedWizard\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebrandonfarrell%2Freact-native-navigation-drawer-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukebrandonfarrell%2Freact-native-navigation-drawer-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebrandonfarrell%2Freact-native-navigation-drawer-extension/lists"}