Highlight A Keyword In A Piece Of Text

Description:

A React component that highlights a keyword in a piece of text and returns a React element.

How to use it:

1. Install & import.

# NPM
$ npm i react-keywords
import React from 'react';
import Keywords from 'react-keywords';

2. Basic usage.

export default function Demo() {
  return (
    <Keywords value="react">
      Your Text Here
    </Keywords>
  );
}

Preview:

Highlight A Keyword In A Piece Of Text

Add Comment