{"id":18850782,"url":"https://github.com/luqmanoop/react-highlight-pop","last_synced_at":"2025-04-14T09:41:04.047Z","repository":{"id":97223227,"uuid":"170111999","full_name":"luqmanoop/react-highlight-pop","owner":"luqmanoop","description":"React component for \"medium-like\" text highlight","archived":false,"fork":false,"pushed_at":"2019-05-07T22:49:08.000Z","size":323,"stargazers_count":52,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:33:01.683Z","etag":null,"topics":["highlight-text","medium-highlight","react","share-highlight-text"],"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/luqmanoop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-11T10:45:01.000Z","updated_at":"2024-01-05T11:22:10.000Z","dependencies_parsed_at":"2023-05-17T08:46:40.363Z","dependency_job_id":null,"html_url":"https://github.com/luqmanoop/react-highlight-pop","commit_stats":null,"previous_names":["luqmanoop/react-highlight-pop","codeshifu/react-highlight-pop"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-highlight-pop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-highlight-pop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-highlight-pop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-highlight-pop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luqmanoop","download_url":"https://codeload.github.com/luqmanoop/react-highlight-pop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855699,"owners_count":21172628,"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":["highlight-text","medium-highlight","react","share-highlight-text"],"created_at":"2024-11-08T03:31:36.500Z","updated_at":"2025-04-14T09:41:04.026Z","avatar_url":"https://github.com/luqmanoop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-highlight-pop\n\u003e React component for \"medium-like\" text highlight\n\n[![](https://img.shields.io/npm/v/react-highlight-pop.svg?style=popout)](https://www.npmjs.com/package/react-highlight-pop)\n[![](https://img.shields.io/travis/codeshifu/react-highlight-pop.svg?style=popout)](https://travis-ci.org/codeshifu/react-highlight-pop)\n[![](https://img.shields.io/coveralls/github/codeshifu/react-highlight-pop.svg?style=popout)](https://coveralls.io/github/codeshifu/react-highlight-pop)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nA configurable text highlight component with zero dependencies\n\n![demo](https://user-images.githubusercontent.com/5154605/52847235-ebae9800-310b-11e9-9387-e3797fa4bdae.gif)\n\n## Installation\n```bash\nnpm install react-highlight-pop\n```\n\n## Usage\n1. Import/require `react-highlight-pop` after installation\n```javascript\nimport HighlightPop from 'react-highlight-pop';\n```\nor \n```javascript\nconst HighlightPop = require('react-highlight-pop');\n```\n2. Wrap the text you want to be highlightable with `react-highlight-pop`\n```javascript\nconst App = () =\u003e {\n    return (\n        \u003cHighlightPop\u003e\n            \u003cp\u003eYou can highlight me\u003c/p\u003e\n            \u003cp\u003eI will show a popover when you highlight me\u003c/p\u003e\n        \u003c/HighlightPop\u003e\n    )\n}\n```\n\n### Custom popover items\nYou can define custom popover items by defining the `popoverItems` prop, whose value is a function that returns jsx.\n\nNOTE: You should always pass your custom popover items.\n\nExample\n```javascript\nconst App = () =\u003e {\n    return (\n        \u003cHighlightPop \n            popoverItems={itemClass =\u003e (\n             \u003cFragment\u003e\n                \u003cspan \n                    className={itemClass} onClick={() =\u003e alert('sharing')}\u003e\n                    share\n                \u003c/span\u003e\n             \u003c/Fragment\u003e\n            )}\u003e\n            \u003cp\u003eYou can highlight me\u003c/p\u003e\n            \u003cp\u003eI will show a popover when you highlight me\u003c/p\u003e\n        \u003c/HighlightPop\u003e\n    )\n}\n```\n\n# API\n## Props\nprop|value|description\n---|---|---\npopoverItems|function| A function that returns jsx. Returned jsx display as popover items when a text is highlighted.\nonHighlightPop|function| Callback function that's invoked whenever a text is highlighted.\nchildren|node| The text/group of text that's highlightable\n\n## Contributing\n1. Fork the repo \n2. Create your feature branch (`git checkout -b my-awesome-feature`)\n3. Make changes to the lib file `src/lib/index.js`\n4. Write test for changes/features added in `__tests__/HighlightPop.test.js`\n5. Commit your changes (`git commit -am 'Awesome feature added'`)\n6. Push to the branch (`git push origin my-awesome-feature`)\n7. Raise a Pull Request\n\n## License\n**react-highlight-pop** is licensed under [MIT](https://github.com/codeshifu/react-highlight-pop/blob/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Freact-highlight-pop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluqmanoop%2Freact-highlight-pop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Freact-highlight-pop/lists"}