finds.dev

bvaughn/react-highlight-words

React component to highlight words within a larger body of text

View on GitHubHomepage ↗

★ 2,303JavaScriptMITupdated Jan 2025

// the take

A React component that wraps text and highlights matching search terms. It delegates the chunking logic to a separate `highlight-words-core` package, which makes it testable in isolation. Aimed at anyone building search UIs, autocomplete dropdowns, or any text that needs match highlighting.

The `findChunks` escape hatch is genuinely useful — you can swap in fuzzy matching, diacritic folding, or any custom logic without forking the component. The `sanitize` prop handles accent normalization cleanly, which most similar libraries ignore. The `activeIndex` prop for stepping through matches is a nice touch for keyboard-navigable search results. Core logic lives in `highlight-words-core` as a plain JS package, so you can reuse it outside React without pulling in the component.

The repo is effectively unmaintained — last meaningful activity was years ago, the CI uses CircleCI with a config that likely no longer runs, and it's still on Webpack 3-era build tooling. There are no TypeScript types shipped in the package; you need `@types/react-highlight-words` from DefinitelyTyped, which lags behind. The component only accepts a flat string for `textToHighlight`, so if your text already contains JSX or HTML, you're on your own. With 2300 stars and no active maintainer, any bug you hit is probably yours to fix.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
2,303
Forks
179
Language
JavaScript
License
MIT
Last commit
12 Jan 2025

// nearby

If react-highlight-words isn't quite it.

All repos →