{"id":13406368,"url":"https://github.com/fkhadra/react-contexify","last_synced_at":"2025-05-13T20:17:52.693Z","repository":{"id":10683391,"uuid":"61522429","full_name":"fkhadra/react-contexify","owner":"fkhadra","description":"👌 Add a context menu to your react app with ease","archived":false,"fork":false,"pushed_at":"2024-11-25T01:12:32.000Z","size":8747,"stargazers_count":1204,"open_issues_count":48,"forks_count":124,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-09T20:53:56.775Z","etag":null,"topics":["context-menu","dropdown","menu","popup","react","react-component"],"latest_commit_sha":null,"homepage":"https://fkhadra.github.io/react-contexify/","language":"TypeScript","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/fkhadra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"fkhadra"}},"created_at":"2016-06-20T06:32:23.000Z","updated_at":"2025-05-09T07:32:11.000Z","dependencies_parsed_at":"2024-06-18T12:21:30.438Z","dependency_job_id":"98485490-9535-4130-9c54-f778bc33738a","html_url":"https://github.com/fkhadra/react-contexify","commit_stats":{"total_commits":416,"total_committers":18,"mean_commits":23.11111111111111,"dds":0.07451923076923073,"last_synced_commit":"8d9fc63ac13040d3250e8eefd593d50a3ebdd1e6"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkhadra%2Freact-contexify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkhadra%2Freact-contexify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkhadra%2Freact-contexify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkhadra%2Freact-contexify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fkhadra","download_url":"https://codeload.github.com/fkhadra/react-contexify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020658,"owners_count":22000757,"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":["context-menu","dropdown","menu","popup","react","react-component"],"created_at":"2024-07-30T19:02:28.303Z","updated_at":"2025-05-13T20:17:52.632Z","avatar_url":"https://github.com/fkhadra.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fkhadra"],"categories":["TypeScript","React"],"sub_categories":["React Components"],"readme":"\u003cimg width=\"645\" alt=\"screenshot 2018-10-31 at 13 32 57\" src=\"https://user-images.githubusercontent.com/5574267/47815610-1806fa00-dd51-11e8-981b-2f680244ae29.png\"\u003e\n\n![React-contexify CI](https://github.com/fkhadra/react-contexify/workflows/React-contexify%20CI/badge.svg) [![npm](https://img.shields.io/npm/dm/react-contexify.svg)]() [![npm](https://img.shields.io/npm/v/react-contexify.svg)]() [![license](https://img.shields.io/github/license/fkhadra/react-contexify.svg?maxAge=2592000)]()\n\n\u003cdiv style=\"text-align:center\"\u003e\n\n![contexify](https://user-images.githubusercontent.com/5574267/100552409-500dfd80-3287-11eb-96ee-fc1d17ef50b8.gif)\n\n\u003c/div\u003e\n\n## Features\n\n- Easy to set up for real, you can make it work in less than 10sec!\n- Super easy to customize thanks to css variables 💅\n- Custom position\n- Sub menu support\n- Does not go offscreen\n- Dark mode 🌒\n- Keyboard navigation + keyboard shortcut!\n- Built-in animations\n- Easy to test!\n- Written in Typescript 💪\n- Tiny! (3k gzipped)\n\nCheck the documentation for more!\n\n\n## Documentation\n\nGo [here](https://fkhadra.github.io/react-contexify). \n\n## Installation\n\nUsing yarn\n\n```sh\n$ yarn add react-contexify\n```\n\nUsing npm\n\n```sh\n$ npm install --save react-contexify\n```\n\n## The gist\n\n```js\nimport { Menu, Item, Separator, Submenu, useContextMenu } from 'react-contexify';\nimport 'react-contexify/ReactContexify.css';\n\nconst MENU_ID = 'blahblah';\n\nfunction App() {\n  const { show } = useContextMenu({\n    id: MENU_ID,\n  });\n\n  function handleContextMenu(event){\n      show({\n        event,\n        props: {\n            key: 'value'\n        }\n      })\n  }\n\n  // I'm using a single event handler for all items\n  // but you don't have too :)\n  const handleItemClick = ({ id, event, props }) =\u003e {\n    switch (id) {\n      case \"copy\":\n        console.log(event, props)\n        break;\n      case \"cut\";\n        console.log(event, props);\n        break;\n      //etc...\n    }\n  }\n\n  return (\n    \u003cdiv\u003e\n    \u003cp onContextMenu={handleContextMenu}\u003elorem ipsum blabladhasi blaghs blah\u003c/p\u003e  \n    \u003cMenu id={MENU_ID}\u003e\n      \u003cItem id=\"copy\" onClick={handleItemClick}\u003eCopy\u003c/Item\u003e\n      \u003cItem id=\"cut\" onClick={handleItemClick}\u003eCut\u003c/Item\u003e\n      \u003cSeparator /\u003e\n      \u003cItem disabled\u003eDisabled\u003c/Item\u003e\n      \u003cSeparator /\u003e\n      \u003cSubmenu label=\"Foobar\"\u003e\n        \u003cItem id=\"reload\" onClick={handleItemClick}\u003eReload\u003c/Item\u003e\n        \u003cItem id=\"something\" onClick={handleItemClick}\u003eDo something else\u003c/Item\u003e\n      \u003c/Submenu\u003e\n    \u003c/Menu\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Contribute\n\nAny idea and suggestions are welcome. Please have a look at the contributing guide.\n\n## License\n\nReact Contexify is licensed under MIT. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkhadra%2Freact-contexify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffkhadra%2Freact-contexify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkhadra%2Freact-contexify/lists"}