{"id":24780346,"url":"https://github.com/agjs/react-context-menu","last_synced_at":"2025-10-07T13:41:24.016Z","repository":{"id":43895286,"uuid":"344829981","full_name":"agjs/react-context-menu","owner":"agjs","description":"React library for invoking the context menu.","archived":false,"fork":false,"pushed_at":"2021-03-24T10:16:44.000Z","size":96,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T01:24:37.198Z","etag":null,"topics":["react","react-context","react-context-menu"],"latest_commit_sha":null,"homepage":"","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/agjs.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":"2021-03-05T14:07:25.000Z","updated_at":"2023-12-25T01:11:02.000Z","dependencies_parsed_at":"2022-09-15T18:50:32.246Z","dependency_job_id":null,"html_url":"https://github.com/agjs/react-context-menu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agjs/react-context-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agjs%2Freact-context-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agjs%2Freact-context-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agjs%2Freact-context-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agjs%2Freact-context-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agjs","download_url":"https://codeload.github.com/agjs/react-context-menu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agjs%2Freact-context-menu/sbom","scorecard":{"id":170667,"data":{"date":"2025-08-11","repo":{"name":"github.com/agjs/react-context-menu","commit":"b773efb514232ac35665771e3f73f102c017aad8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"29 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T16:21:47.156Z","repository_id":43895286,"created_at":"2025-08-16T16:21:47.156Z","updated_at":"2025-08-16T16:21:47.156Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786343,"owners_count":26045586,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","react-context","react-context-menu"],"created_at":"2025-01-29T10:21:42.801Z","updated_at":"2025-10-07T13:41:23.978Z","avatar_url":"https://github.com/agjs.png","language":"JavaScript","readme":"# react-right-click-menu\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"150\" height=\"150\" src=\"./assets/images/react-context-menu.svg\"\u003e\n\u003c/p\u003e\n\nMinimalistic provider built around native [Contextmenu Event](https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event).\n\nUnlike many similar libraries, react-right-click-menu simply provides a context environment, where consumer provides an actual DOM node (a reference) to an element that should trigger the menu and the component that should be rendered when the event occurs.\n\nThis makes it easy to intergrate your own UI library and show your own UI Components when a context menu is triggered. That being said, react-right-click-menu doesn't carry over any content or styling, nor it installs any additional dependencies.\n\n## [CodeSandbox Demo](https://codesandbox.io/s/elegant-tharp-2vhjg?file=/src/App.js)\n\n## Install\n\n#### NPM\n\n\u003e npm i @agjs/react-right-click-menu\n\n#### YARN\n\n\u003e yarn add @agjs/react-right-click-menu\n\n## Props\n\n| Props                  | Description                                                                                                                                                                                                                       | Default |\n| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |\n| trigger                | A react reference to an element that will trigger the menu on right click                                                                                                                                                         | null    |\n| component              | A component to show when trigger is right clicked                                                                                                                                                                                 | null    |\n| isOpenAfterInteraction | Determines if a menu should remain open after user interacts with it. For instance, maybe you will render a list of checkboxes that user has to interact with, and you don't want menu to close it after each interaction (click) | true    |\n| className              | A custom className in case you want to apply custom styling to the context wrapper                                                                                                                                                | null    |\n| isOpen                 | Self-explanatory                                                                                                                                                                                                                  | false   |\n| setIsOpen              | Self-explanatory                                                                                                                                                                                                                  | -       |\n\n## Use\n\n```js\nimport React, { useRef, useState } from \"react\";\nimport ContextMenu from \"@agjs/react-right-click-menu\";\nimport SomeUiComponent from \"somewhere\";\n\nexport const ExampleComponent = () =\u003e {\n  const [isMenuShown, setIsMenuShown] = useState(false);\n  const ref = useRef();\n  return (\n    \u003c\u003e\n      \u003cContextMenu\n        isOpenAfterInteraction={false}\n        trigger={ref}\n        component={\u003cSomeUiComponent /\u003e}\n        isOpen={isMenuShown}\n        setIsOpen={setIsMenuShown}\n      /\u003e\n      \u003cdiv className=\"foo\" ref={ref}\u003e\n        Once someone right-clicks inside of me, I will trigger some content!\n      \u003c/div\u003e\n    \u003c/\u003e\n  );\n};\n```\n\n## Transitions\n\n#### Example using [react-motion](https://github.com/chenglou/react-motion)\n\nTo keep the minimal footprint, react-right-click-menu doesn't apply any transitions to the component triggered. This decision was made in order to keep minimal amount of external dependencies and to allow a consumer to add them if they wish.\n\nIn the showcase below, we can see how we used a [render-prop](https://reactpatterns.com/#render-prop) from [react-motion](https://github.com/chenglou/react-motion) to generate some inline-styles and pass them down to the ContextMenu.\n\n```js\nimport React, { useRef, useState } from \"react\";\nimport ContextMenu from \"@agjs/react-right-click-menu\";\nimport { Motion, spring } from \"react-motion\";\nimport ContextMenu from \"./index\";\nimport Foo from \"somewhere\";\n\nexport const ExampleComponent = () =\u003e {\n  const [isMenuShown, setIsMenuShown] = useState(false);\n  const ref = useRef();\n  return (\n    \u003c\u003e\n      \u003cMotion\n        defaultStyle={{ opacity: 0 }}\n        style={{\n          opacity: !isMenuShown ? spring(0) : spring(1),\n        }}\n      \u003e\n        {(interpolatedStyle) =\u003e {\n          return (\n            \u003cContextMenu\n              trigger={ref}\n              component={\u003cFoo /\u003e}\n              isOpen={isMenuShown}\n              setIsOpen={setIsMenuShown}\n              style={{ opacity: interpolatedStyle.opacity }}\n            /\u003e\n          );\n        }}\n      \u003c/Motion\u003e\n      \u003cdiv ref={ref} style={customStyles}\u003e\n        Right click inside of me!\n      \u003c/div\u003e\n    \u003c/\u003e\n  );\n};\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagjs%2Freact-context-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagjs%2Freact-context-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagjs%2Freact-context-menu/lists"}