smartprocure / react-text-highlight

𝐓 Simple React component for highlight a text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No Maintenance Intended

No Maintenance Intended

This project is no longer actively maintained.


Demo

Demo

To run it locally:

npm install
npm run examples
open localhost:8080

Install

npm install --save react-text-highlight

## Usage

import React from 'react';
import TextHighlight from 'react-text-highlight';

class App extends React.Component {

  render() {
    return (
      <div>
        <TextHighlight
          highlight="ago"
          text="A long time ago, in a galaxy far, far away...."
        />
      </div>
    );
  }
}

Properties

highlight

String to be highlighted.

text

Text to look for highlighted value.

markTag

The HTML element name for the highlighted text, the default is mark.

caseSensitive

Boolean value for case sensitive search, the default is false.

About

𝐓 Simple React component for highlight a text

License:MIT License


Languages

Language:JavaScript 85.4%Language:Shell 11.9%Language:CSS 2.8%