react-highlight-words renders text with specified substrings highlighted, useful for search results, find-in-page UIs, and autocomplete menus. You pass a string (or node tree) and an array of search terms, and the component splits content into matched and unmatched chunks with minimal overhead. It supports case-sensitive or insensitive matching and optional auto-escaping so user-entered queries won’t be treated as regex. For advanced scenarios, you can provide a custom findChunks function to control tokenization (e.g., word boundaries or diacritics-aware behavior). The highlight output is easy to restyle via a custom tag (like mark) or inline styles, keeping the visual layer decoupled from the matching logic. Because it’s small and framework-idiomatic, it drops into tables, lists, virtualized scroll areas, and complex UIs without forcing layout changes.

Features

  • Simple API: input text plus searchWords array yields highlighted chunks
  • Case-sensitive or insensitive matching with optional auto-escape
  • Custom findChunks for advanced tokenization strategies
  • Configurable highlight wrapper element and styles
  • Works with plain strings or nested React nodes
  • Lightweight and composable for search results and autocompletes

Project Samples

Project Activity

See All Activity >

Categories

Text Editors

License

MIT License

Follow react-highlight-words

react-highlight-words Web Site

Other Useful Business Software
Simple, Secure Domain Registration Icon
Simple, Secure Domain Registration

Get your domain at wholesale price. Cloudflare offers simple, secure registration with no markups, plus free DNS, CDN, and SSL integration.

Register or renew your domain and pay only what we pay. No markups, hidden fees, or surprise add-ons. Choose from over 400 TLDs (.com, .ai, .dev). Every domain is integrated with Cloudflare's industry-leading DNS, CDN, and free SSL to make your site faster and more secure. Simple, secure, at-cost domain registration.
Sign up for free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of react-highlight-words!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Text Editors

Registered

3 days ago