react-highlight-text

Highlight text react

Usage no npm install needed!

<script type="module">
  import reactHighlightText from 'https://cdn.skypack.dev/react-highlight-text';
</script>

README

npm downloads

react-highlight-text

Quick start

import React from 'react';
import ReactDOM from 'react-dom';
import HighlightText from 'react-highlight-text';

const Text = () => {
    const style = { backgroundColor: 'yellow' };
    return (
        <div>
            <HighlightText text={'example text'} searchQuery={'text'} style={style} />
            <HighlightText text={'example text'} searchQuery={'exam'} style={style} />
        </div>
    );
};

Installation

react-highlight-text requires React >= 0.14

npm

npm install --save react-highlight-text