{"id":19220069,"url":"https://github.com/nativescript-community/ui-drawer","last_synced_at":"2025-06-22T09:40:11.885Z","repository":{"id":39333086,"uuid":"303809491","full_name":"nativescript-community/ui-drawer","owner":"nativescript-community","description":"NativeScript plugin that allows you to easily add a side drawer (side menu) to your projects.","archived":false,"fork":false,"pushed_at":"2024-12-18T08:37:16.000Z","size":9452,"stargazers_count":25,"open_issues_count":7,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T09:04:34.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nativescript-community.github.io/ui-drawer/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nativescript-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["farfromrefug"]}},"created_at":"2020-10-13T19:33:05.000Z","updated_at":"2025-05-17T22:13:10.000Z","dependencies_parsed_at":"2024-02-27T21:31:33.505Z","dependency_job_id":"27391956-978e-4838-9054-e9871f4edb4f","html_url":"https://github.com/nativescript-community/ui-drawer","commit_stats":{"total_commits":201,"total_committers":8,"mean_commits":25.125,"dds":0.527363184079602,"last_synced_commit":"b878da5b372b06a5ccd3b2a31b3a5bc37d94ed16"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/nativescript-community/ui-drawer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fui-drawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fui-drawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fui-drawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fui-drawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativescript-community","download_url":"https://codeload.github.com/nativescript-community/ui-drawer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fui-drawer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261272605,"owners_count":23133795,"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":[],"created_at":"2024-11-09T14:33:52.051Z","updated_at":"2025-06-22T09:40:06.856Z","avatar_url":"https://github.com/nativescript-community.png","language":"TypeScript","funding_links":["https://github.com/sponsors/farfromrefug"],"categories":["Plugins"],"sub_categories":["UI Plugins"],"readme":"\u003c!-- ⚠️ This README has been generated from the file(s) \"blueprint.md\" ⚠️--\u003e\u003c!-- ⚠️ This README has been generated from the file(s) \"blueprint.md\" ⚠️--\u003e\n\u003c!--  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      DO NOT EDIT THIS READEME DIRECTLY! Edit \"bluesprint.md\" instead.\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --\u003e\n\u003ch1 align=\"center\"\u003e@nativescript-community/ui-drawer\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\t\t\u003ca href=\"https://npmcharts.com/compare/@nativescript-community/ui-drawer?minimal=true\"\u003e\u003cimg alt=\"Downloads per month\" src=\"https://img.shields.io/npm/dm/@nativescript-community/ui-drawer.svg\" height=\"20\"/\u003e\u003c/a\u003e\r\n\u003ca href=\"https://www.npmjs.com/package/@nativescript-community/ui-drawer\"\u003e\u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/@nativescript-community/ui-drawer.svg\" height=\"20\"/\u003e\u003c/a\u003e\n\t\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eEasily add a side drawer (side menu) to your projects.\u003c/b\u003e\u003c/br\u003e\n  \u003csub\u003e\u003csub\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\n| \u003cimg src=\"https://raw.githubusercontent.com/nativescript-community/ui-drawer/master/images/demo-ios.gif\" height=\"500\" /\u003e | \u003cimg src=\"https://raw.githubusercontent.com/nativescript-community/ui-drawer/master/images/demo-android.gif\" height=\"500\" /\u003e |\n| --- | ----------- |\n| iOS Demo | Android Demo |\n\n\r\n[](#table-of-contents)\r\n\r\n\r\n[](#table-of-contents)\r\n\r\n## Table of Contents\n\n* [Installation](#installation)\r\n* [Configuration](#configuration)\r\n* [API](#api)\r\n\t* [Properties](#properties)\r\n\t* [Methods](#methods)\r\n\t* [Events](#events)\r\n* [Usage in Angular](#usage-in-angular)\r\n\t* [Examples:](#examples)\r\n* [Usage in React](#usage-in-react)\r\n\t* [Examples:](#examples-1)\r\n* [Usage in Svelte](#usage-in-svelte)\r\n\t* [Examples:](#examples-2)\r\n* [Usage in Vue](#usage-in-vue)\r\n\t* [Examples:](#examples-3)\r\n* [Usage in Vue3](#usage-in-vue3)\r\n\t* [Examples:](#examples-4)\r\n* [Demos and Development](#demos-and-development)\r\n\t* [Repo Setup](#repo-setup)\r\n\t* [Build](#build)\r\n\t* [Demos](#demos)\r\n* [Contributing](#contributing)\r\n\t* [Update repo ](#update-repo-)\r\n\t* [Update readme ](#update-readme-)\r\n\t* [Update doc ](#update-doc-)\r\n\t* [Publish](#publish)\r\n\t* [modifying submodules](#modifying-submodules)\r\n* [Questions](#questions)\n\n\r\n[](#installation)\r\n\r\n\r\n[](#installation)\r\n\r\n## Installation\nRun the following command from the root of your project:\n\n`ns plugin add @nativescript-community/ui-drawer`\n\n\r\n[](#configuration)\r\n\r\n\r\n[](#configuration)\r\n\r\n## Configuration\nFor gestures to work, make sure to add the following code block inside the main application file (e.g. app.ts):\n\n```typescript\nimport { install } from '@nativescript-community/ui-drawer';\ninstall();\n```\n\n\r\n[](#api)\r\n\r\n\r\n[](#api)\r\n\r\n## API\n\n### Properties\n\n| Property            | Default                           | Type                        | Description                                             |\n| ------------------- | --------------------------------- | --------------------------- | ------------------------------------------------------- |\n| leftDrawer          | `undefined`                       | `View`                      | View containing the content for the left side drawer    |\n| rightDrawer         | `undefined`                       | `View`                      | View containing the content for the right side drawer   |\n| topDrawer          | `undefined`                       | `View`                      | View containing the content for the top side drawer    |\n| bottomDrawer         | `undefined`                       | `View`                      | View containing the content for the bottom side drawer   |\n| mainContent         | `undefined`                       | `View`                      | View containing the main content of the app             |\n| gestureEnabled      | `true`                            | `boolean`                   | Boolean setting if swipe gestures are enabled           |\n| backdropTapGestureEnabled       | `true` | `boolean`                     | Allow tapping the backdrop to close the drawer             |\n| backdropColor       | `new Color('rgba(0, 0, 0, 0.7)')` | `Color`                     | The color of the backdrop behind the drawer             |\n| leftDrawerMode      | `slide`                           | `Mode ('under' or 'slide')` | The drawer's enter-animation behavior             |\n| rightDrawerMode     | `slide`                           | `Mode ('under' or 'slide')` | The drawer's enter-animation behavior             |\n| gestureMinDist     | `10`                           | number | The min \"swipe\" distance to trigger the menu gesture             |\n| gestureHandlerOptions     | `null`                           | PanGestureHandlerOptions | Options to customize the pan gesture handler             |\n| leftSwipeDistance     | `40`                           | number | The \"left\" zone size from where the gesture is recognized             |\n| rightSwipeDistance     | `40`                           | number | The \"right\" zone size from where the gesture is recognized             |\n| topSwipeDistance     | `40`                           | number | The \"top\" zone size from where the gesture is recognized             |\n| bottomSwipeDistance     | `40`                           | number | The \"bottom\" zone size from where the gesture is recognized             |\n| leftOpenedDrawerAllowDraging     | `true`                           | boolean | Allow dragging the opened menu             |\n| rightOpenedDrawerAllowDraging     | `true`                           | boolean | Allow dragging the opened menu             |\n| topOpenedDrawerAllowDraging     | `true`                           | boolean | Allow dragging the opened menu             |\n| bottomOpenedDrawerAllowDraging     | `true`                           | boolean | Allow dragging the opened menu             |\n\n\n\n### Methods\n\n| Name         | Return | Description                                     |\n| ------------ | ------ | ----------------------------------------------- |\n| open()       | `void` | Programatically open the drawer                 |\n| close()      | `void` | Programatically close the drawer                |\n| toggle()     | `void` | Programatically toggle the state of the drawer  |\n| install()    | `void` | Install gestures                                |\n\n### Events\n\n| Name      | Event Data         | Description                  |\n| --------- | ------------------ | ---------------------------- |\n| open      | `side`, `duration` | Drawer opens                 |\n| close     | `side`, `duration` | Drawer closes                |\n\n\r\n[](#usage-in-angular)\r\n\r\n\r\n[](#usage-in-angular)\r\n\r\n## Usage in Angular\nImport the module into your project.\n\n```typescript\nimport { DrawerModule } from \"@nativescript-community/ui-drawer/angular\";\n\n@NgModule({\n    imports: [\n        DrawerModule\n    ]\n    schemas: [\n        NO_ERRORS_SCHEMA\n    ]\n})\n\nexport class AppModule { }\n```\n\n### Examples:\n\n- [Basic Drawer](demo-snippets/ng/basic-drawer)\n  - A basic sliding drawer.\n- [All Sides](demo-snippets/ng/all-sides)\n  - An example of drawers on all sides: left, right, top, bottom.\n\n\n\r\n[](#usage-in-react)\r\n\r\n\r\n[](#usage-in-react)\r\n\r\n## Usage in React\n\nRegister the plugin in your `app.ts`.\n\n```typescript\nimport DrawerElement from '@nativescript-community/ui-drawer/react';\nDrawerElement.register();\n```\n\n### Examples:\n\n- [Basic Drawer](demo-snippets/react/BasicDrawer.tsx)\n  - A basic sliding drawer.\n- [All Sides](demo-snippets/react/AllSides.tsx)\n  - An example of drawers on all sides: left, right, top, bottom.\n\n\r\n[](#usage-in-svelte)\r\n\r\n\r\n[](#usage-in-svelte)\r\n\r\n## Usage in Svelte\n\nRegister the plugin in your `app.ts`.\n\n```typescript\nimport DrawerElement from '@nativescript-community/ui-drawer/svelte';\nDrawerElement.register();\n```\n\n### Examples:\n\n- [Basic Drawer](demo-snippets/svelte/BasicDrawer.svelte)\n  - A basic sliding drawer.\n- [All Sides](demo-snippets/svelte/AllSides.svelte)\n  - An example of drawers on all sides: left, right, top, bottom.\n\n\r\n[](#usage-in-vue)\r\n\r\n\r\n[](#usage-in-vue)\r\n\r\n## Usage in Vue\n\nRegister the plugin in your `app.js`.\n\n```typescript\nimport DrawerPlugin from '@nativescript-community/ui-drawer/vue'\nVue.use(DrawerPlugin);\n```\n\n### Examples:\n\n- [Basic Drawer](demo-snippets/vue/BasicDrawer.vue)\n  - A basic sliding drawer.\n- [All Sides](demo-snippets/vue/AllSides.vue)\n  - An example of drawers on all sides: left, right, top, bottom.\n\n\r\n[](#usage-in-vue3)\r\n\r\n\r\n[](#usage-in-vue3)\r\n\r\n## Usage in Vue3\n\nRegister the plugin in your `app.js`.\n\n```typescript\nimport DrawerPlugin from '@nativescript-community/ui-drawer/vue3'\n\napp.use(DrawerPlugin);\n```\n\n### Examples:\n\n- [Basic Drawer](demo-snippets/vue3/BasicDrawer.vue)\n  - A basic sliding drawer.\n- [All Sides](demo-snippets/vue3/AllSides.vue)\n  - An example of drawers on all sides: left, right, top, bottom.\n\n\r\n[](#demos-and-development)\r\n\r\n\r\n[](#demos-and-development)\r\n\r\n## Demos and Development\n\n\n### Repo Setup\n\nThe repo uses submodules. If you did not clone with ` --recursive` then you need to call\n```\ngit submodule update --init\n```\n\nThe package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.\n\nTo develop and test:\nif you use `yarn` then run `yarn`\nif you use `pnpm` then run `pnpm i`\n\n**Interactive Menu:**\n\nTo start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.\n\n### Build\n\n```bash\nnpm run build.all\n```\nWARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`\n\n### Demos\n\n```bash\nnpm run demo.[ng|react|svelte|vue].[ios|android]\n\nnpm run demo.svelte.ios # Example\n```\n\nDemo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`\nInstead you work in `demo-snippets/[ng|react|svelte|vue]`\nYou can start from the `install.ts` of each flavor to see how to register new demos \n\n\r\n[](#contributing)\r\n\r\n\r\n[](#contributing)\r\n\r\n## Contributing\n\n### Update repo \n\nYou can update the repo files quite easily\n\nFirst update the submodules\n\n```bash\nnpm run update\n```\n\nThen commit the changes\nThen update common files\n\n```bash\nnpm run sync\n```\nThen you can run `yarn|pnpm`, commit changed files if any\n\n### Update readme \n```bash\nnpm run readme\n```\n\n### Update doc \n```bash\nnpm run doc\n```\n\n### Publish\n\nThe publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)\nSimply run \n```shell\nnpm run publish\n```\n\n### modifying submodules\n\nThe repo uses https:// for submodules which means you won't be able to push directly into the submodules.\nOne easy solution is t modify `~/.gitconfig` and add\n```\n[url \"ssh://git@github.com/\"]\n\tpushInsteadOf = https://github.com/\n```\n\n\r\n[](#questions)\r\n\r\n\r\n[](#questions)\r\n\r\n## Questions\n\nIf you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).\n\n\r\n[](#demos-and-development)\r\n\r\n## Demos and Development\n\n\n### Repo Setup\n\nThe repo uses submodules. If you did not clone with ` --recursive` then you need to call\n```\ngit submodule update --init\n```\n\nThe package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.\n\nTo develop and test:\nif you use `yarn` then run `yarn`\nif you use `pnpm` then run `pnpm i`\n\n**Interactive Menu:**\n\nTo start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.\n\n### Build\n\n```bash\nnpm run build.all\n```\nWARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`\n\n### Demos\n\n```bash\nnpm run demo.[ng|react|svelte|vue].[ios|android]\n\nnpm run demo.svelte.ios # Example\n```\n\nDemo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`\nInstead you work in `demo-snippets/[ng|react|svelte|vue]`\nYou can start from the `install.ts` of each flavor to see how to register new demos \n\n\r\n[](#contributing)\r\n\r\n## Contributing\n\n### Update repo \n\nYou can update the repo files quite easily\n\nFirst update the submodules\n\n```bash\nnpm run update\n```\n\nThen commit the changes\nThen update common files\n\n```bash\nnpm run sync\n```\nThen you can run `yarn|pnpm`, commit changed files if any\n\n### Update readme \n```bash\nnpm run readme\n```\n\n### Update doc \n```bash\nnpm run doc\n```\n\n### Publish\n\nThe publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)\nSimply run \n```shell\nnpm run publish\n```\n\n### modifying submodules\n\nThe repo uses https:// for submodules which means you won't be able to push directly into the submodules.\nOne easy solution is t modify `~/.gitconfig` and add\n```\n[url \"ssh://git@github.com/\"]\n\tpushInsteadOf = https://github.com/\n```\n\r\n[](#questions)\r\n\r\n## Questions\n\nIf you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fui-drawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript-community%2Fui-drawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fui-drawer/lists"}