{"id":16791960,"url":"https://github.com/metonym/react-fuzzy-highlighter","last_synced_at":"2025-03-22T01:30:33.593Z","repository":{"id":34996431,"uuid":"194576811","full_name":"metonym/react-fuzzy-highlighter","owner":"metonym","description":"Lightweight fuzzy search highlighting component using fuse.js","archived":false,"fork":false,"pushed_at":"2023-01-09T02:19:09.000Z","size":1552,"stargazers_count":27,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T19:59:30.252Z","etag":null,"topics":["fusejs","fuzzy","highlight","highlight-words","react","text-highlighter"],"latest_commit_sha":null,"homepage":"https://metonym.github.io/react-fuzzy-highlighter","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/metonym.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-01T00:58:18.000Z","updated_at":"2024-06-18T08:47:34.000Z","dependencies_parsed_at":"2023-01-15T11:45:25.733Z","dependency_job_id":null,"html_url":"https://github.com/metonym/react-fuzzy-highlighter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Freact-fuzzy-highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Freact-fuzzy-highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Freact-fuzzy-highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Freact-fuzzy-highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metonym","download_url":"https://codeload.github.com/metonym/react-fuzzy-highlighter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244893306,"owners_count":20527565,"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":["fusejs","fuzzy","highlight","highlight-words","react","text-highlighter"],"created_at":"2024-10-13T08:43:40.526Z","updated_at":"2025-03-22T01:30:33.316Z","avatar_url":"https://github.com/metonym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-fuzzy-highlighter\n\n\u003e Lightweight fuzzy search highlighting component using [`fuse.js`](https://github.com/krisk/Fuse).\n\nThis component wraps `fuse.js` and provides matched and unmatched text in an iterable format.\n\n## [Demo](https://metonym.github.io/react-fuzzy-highlighter/) · [Changelog](CHANGELOG.md)\n\n## Install\n\n```bash\n# Yarn\nyarn add react-fuzzy-highlighter\n\n# npm\nnpm i react-fuzzy-highlighter\n\n# pnpm\npnpm i react-fuzzy-highlighter\n```\n\n## Usage\n\n```jsx\nimport * as React from \"react\";\nimport FuzzyHighlighter, { Highlighter } from \"react-fuzzy-highlighter\";\n\nexport default class extends React.Component {\n  render() {\n    return (\n      \u003cFuzzyHighlighter\n        query=\"old\"\n        data={[\n          { title: \"Old Man's War\" },\n          { title: \"The Lock Artist\" },\n          { title: \"HTML5\" },\n        ]}\n        options={{\n          shouldSort: true,\n          includeMatches: true,\n          threshold: 0.6,\n          location: 0,\n          distance: 100,\n          maxPatternLength: 32,\n          minMatchCharLength: 1,\n          keys: [\"title\"],\n        }}\n      \u003e\n        {({ results, formattedResults, timing }) =\u003e {\n          return (\n            \u003cul\u003e\n              {formattedResults.map((formattedResult, resultIndex) =\u003e {\n                if (formattedResult.formatted.title === undefined) {\n                  return null;\n                }\n\n                return (\n                  \u003cli key={resultIndex}\u003e\n                    \u003cHighlighter text={formattedResult.formatted.title} /\u003e\n                  \u003c/li\u003e\n                );\n              })}\n            \u003c/ul\u003e\n          );\n        }}\n      \u003c/FuzzyHighlighter\u003e\n    );\n  }\n}\n```\n\n## Example\n\nThe [examples](examples) folder contains the source code used for the [demo](https://metonym.github.io/react-fuzzy-highlighter).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Freact-fuzzy-highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetonym%2Freact-fuzzy-highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Freact-fuzzy-highlighter/lists"}