{"id":13692521,"url":"https://github.com/SmashTapsOS/react-offcanvas-component","last_synced_at":"2025-05-02T19:32:17.876Z","repository":{"id":39420320,"uuid":"202832155","full_name":"SmashTapsOS/react-offcanvas-component","owner":"SmashTapsOS","description":"Off-canvas Sidebar for React ","archived":false,"fork":false,"pushed_at":"2023-01-04T07:28:13.000Z","size":9775,"stargazers_count":10,"open_issues_count":24,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T20:15:49.866Z","etag":null,"topics":["react-animated-sidebar","react-offcanvas","react-offcanvas-component","react-offcanvas-menu","react-sidebar","react-sidebar-menu"],"latest_commit_sha":null,"homepage":"https://samabeywickrama.github.io/roc-examples/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmashTapsOS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-17T03:50:28.000Z","updated_at":"2023-12-01T11:05:58.000Z","dependencies_parsed_at":"2023-02-02T03:31:52.556Z","dependency_job_id":null,"html_url":"https://github.com/SmashTapsOS/react-offcanvas-component","commit_stats":null,"previous_names":["samabeywickrama/react-offcanvas-component"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freact-offcanvas-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freact-offcanvas-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freact-offcanvas-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freact-offcanvas-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmashTapsOS","download_url":"https://codeload.github.com/SmashTapsOS/react-offcanvas-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095372,"owners_count":21693908,"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":["react-animated-sidebar","react-offcanvas","react-offcanvas-component","react-offcanvas-menu","react-sidebar","react-sidebar-menu"],"created_at":"2024-08-02T17:00:59.057Z","updated_at":"2025-05-02T19:32:16.719Z","avatar_url":"https://github.com/SmashTapsOS.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"[![Build Status](https://travis-ci.org/samAbeywickrama/react-offcanvas-component.svg?branch=master)](https://travis-ci.org/samAbeywickrama/react-offcanvas-component)\n![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n# React Offcanvas Component\n\nCreate Off-canvas Sidebars with React and Popmotion's pose\n\n## [**Demo**](https://samabeywickrama.github.io/roc-examples/)\n\n## Installation\n\nThis npm module utilizes `react-pose` for animations.\n\n#### yarn\n\n`yarn add react-pose react-offcanvas-component`\n\n#### npm\n\n`npm i -S react-pose react-offcanvas-component`\n\n## Developments\n\nThis repo uses `Commitizen` for git commit conventions.\n\nRun `yarn commit` or `npm run commit`\n\nYou'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards\n\n## Basic usage\n\nPlease visit this [Repo](https://github.com/samAbeywickrama/roc-examples) for examples.\n\n```js\nimport ReactOffcanvasComponent from \"react-offcanvas-component\";\nimport \"./Basic.css\";\n\nconst { Menu, DropdownMenu, CloseButton } = ReactOffcanvasComponent;\n\nconst openAnimation = {\n  x: 0,\n  transition: {\n    duration: 200\n  }\n};\n\n\u003cReactOffcanvasComponent\n  className=\"wrapper\"\n  open={visibility}\n  openAnimation={openAnimation}\n\u003e\n  \u003cCloseButton onClick={handleClick} style={{ right: 10 }}\u003e\n    x\n  \u003c/CloseButton\u003e\n  \u003cdiv className=\"logo\"\u003eROC\u003c/div\u003e\n  \u003cMenu\u003e\n    \u003cMenuItem className=\"menu-item\"\u003eHome\u003c/MenuItem\u003e\n    \u003cMenuItem className=\"menu-item\"\u003eAnother Menu Item\u003c/MenuItem\u003e\n    \u003cMenuItem hasDropdown name=\"dropdown-b\" className=\"dropdown\"\u003e\n      Dropdown\n      \u003cDropdownMenu\u003e\n        \u003cMenuItem className=\"dropdown-item\"\u003eAbc\u003c/MenuItem\u003e\n        \u003cMenuItem className=\"dropdown-item\"\u003eAbc\u003c/MenuItem\u003e\n        \u003cMenuItem className=\"dropdown-item\"\u003eAbc\u003c/MenuItem\u003e\n      \u003c/DropdownMenu\u003e\n    \u003c/MenuItem\u003e\n    \u003cMenuItem className=\"menu-item\"\u003eIs n't it awesome\u003c/MenuItem\u003e\n  \u003c/Menu\u003e\n\u003c/ReactOffcanvasComponent\u003e;\n```\n\n```css\n.wrapper {\n  width: 400px;\n  background: #fff;\n  padding: 20px;\n}\n.menu-item {\n  margin-bottom: 20px;\n}\n.dropdown {\n  cursor: pointer;\n  margin-bottom: 20px;\n}\n.dropdown-item {\n  padding: 10px;\n  margin-top: 20px;\n  background: #e2e2e2;\n}\n.logo {\n  padding-bottom: 10px;\n  margin-bottom: 20px;\n  border-bottom: 1px solid #e2e2e2;\n  width: 200px;\n}\n```\n\n## API\n\n#### ReactOffcanvasComponent\n\n| Prop             | Type      | Default                                       | Required | Description                                                                   |\n| ---------------- | --------- | --------------------------------------------- | -------- | ----------------------------------------------------------------------------- |\n| open             | `Boolean` | `false`                                       | yes      | Setting values as `true` will Reveal Sidebar and `false` will Hide Sidebar    |\n| className        | `String`  | no                                            | no       | Override the styles applied to the component with css                         |\n| style            | `Object`  | no                                            | no       | Override the styles applied to the component with inline styles               |\n| openAnimation    | `Object`  | [See Default Animations](#default-animations) | no       | Override the default open animation                                           |\n| closeAnimation   | `Object`  | [See Default Animations](#default-animations) | no       | Override the default close animation                                          |\n| overlay          | `Boolean` | false                                         | no       | Show / Hide background overlay                                                |\n| overlayClassName | `String`  | no                                            | no       | Override the default styles applied to the Overlay component with css classes |\n\n#### AnimatedPanel\n\n| Prop           | Type     | Default                                       | Required | Description                                                     |\n| -------------- | -------- | --------------------------------------------- | -------- | --------------------------------------------------------------- |\n| className      | `String` | no                                            | no       | Override the styles applied to the component with css           |\n| style          | `Object` | no                                            | no       | Override the styles applied to the component with inline styles |\n| openAnimation  | `Object` | [See Default Animations](#default-animations) | no       | Override the default open animation                             |\n| closeAnimation | `Object` | [See Default Animations](#default-animations) | no       | Override the default close animation                            |\n\n#### CloseButton\n\n| Prop      | Type       | Default | Required | Description                                                     |\n| --------- | ---------- | ------- | -------- | --------------------------------------------------------------- |\n| onClick   | `Function` | no      | no       | `function(event: object) =\u003e void`                               |\n| style     | `Object`   | no      | no       | Override the styles applied to the component with inline styles |\n| className | `String`   | no      | no       | Override the styles applied to the component with css           |\n\n#### DropdownMenu\n\n| Prop      | Type     | Default | Required | Description                                                     |\n| --------- | -------- | ------- | -------- | --------------------------------------------------------------- |\n| style     | `Object` | no      | no       | Override the styles applied to the component with inline styles |\n| className | `String` | no      | no       | Override the styles applied to the component with css           |\n\n#### DropdownMenu\n\n| Prop      | Type     | Default | Required | Description                                           |\n| --------- | -------- | ------- | -------- | ----------------------------------------------------- |\n| className | `String` | no      | no       | Override the styles applied to the component with css |\n\n#### MenuItem\n\n| Prop                  | Type       | Default | Required | Description                                                       |\n| --------------------- | ---------- | ------- | -------- | ----------------------------------------------------------------- |\n| style                 | `Object`   | no      | no       | Override the styles applied to the component with inline styles   |\n| className             | `String`   | no      | no       | Override the styles applied to the component with css             |\n| onClick               | `Function` | no      | no       | `function(event: object) =\u003e void`                                 |\n| dropdownIconClassName | `String`   | no      | no       | Override the styles applied to the dropdown menu icon with css    |\n| hasDropdown           | `Boolean`  | no      | no       | If the MenuItem contains a dropdown menu set this value to `true` |\n\n### Default Animations\n\nI have used [react-pose](https://popmotion.io/pose/) to create the animations. A tons of customization possible via pose api.\n\n#### ReactOffcanvasComponent\n\n**Open**\n\n```js\n{\n  x: \"-100px\",\n  transition: {\n    ease: [0.175, 0.885, 0.32, 1.275],\n    duration: 300\n  },\n  delayChildren: 150,\n  staggerChildren: 100\n}\n```\n\n**Close**\n\n```js\n{\n  x: \"-100%\",\n  transition: {\n    duration: 100\n  },\n  afterChildren: true\n}\n```\n\n#### AnimatedPanel\n\n**Open**\n\n```js\n{\n  x: \"0%\",\n  transition: {\n    ease: [0.175, 0.885, 0.32, 1.275],\n    duration: 300\n  },\n  delayChildren: 300,\n  staggerChildren: 100\n}\n```\n\n**Close**\n\n```js\n{\n  x: \"-100%\",\n  transition: {\n    duration: 100\n  },\n  afterChildren: true\n}\n```\n\n#### Todo:\n\n- Add tests and coverage reports\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmashTapsOS%2Freact-offcanvas-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSmashTapsOS%2Freact-offcanvas-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmashTapsOS%2Freact-offcanvas-component/lists"}