Text Highlighting Component For React Applications

highlight-react

quickstart

Installation

npm i highlighter-react

#or

yarn add highlighter-react

How to use

import Highlight from 'highlight-react/dist/highlight'

const Demo = () => {
  const searchTerm = 'hello';

  return (
    <Highlight search={searchTerm}>
      <div>
        <h1>Hello world!</h1>
      </div>
    </Highlight>
  );
};

export default Demo;

GitHub

View Github