0.0.6 • Published 4 years ago

react-keyword-highlight v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-keyword-highlight

Takes a string of text and a keyword, and returns a React element with the keyword highlighted in said string of text

To Install:

npm install --save react-keyword-highlight

example

import React from "react";
import highlight from "react-keyword-highlight";
import { text } from "@fortawesome/fontawesome-svg-core";

const PostHeader = props => {

  const {searchKeyword, thumbnailUrl, username} = props

  return (
    <div className="post-header">
      <div className="post-thumb-wrapper">
        <img
          alt="post header"
          className="post-thumb"
          src={thumbnailUrl}
        />
      </div>
  <h2>{highlight(username, searchKeyword)}</h2>
    </div>
  );
};

export default PostHeader;
0.0.5

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago