@devkosta/react-text-marker
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

React Text Marker

A React Component to Dynamically Mark Words within a Body of Text.

Check Out the Demo.

Installation

npm install @devkosta/react-text-marker --save-dev
yarn add @devkosta/react-text-marker

How to Use

import React from 'react';
import { MarkedText } from '@devkosta/react-text-marker';

const Example = () => {
    return (
        <MarkedText
            textToMark='Hello, World! This is some marked text.'
            isCaseSensitive={true}
            markedWords={['Hello', 'marked text']}
            markerColor='#9AE6B4'
        />
    );
};

Props

Property Type Required? Description
textToMark String The text in which the words will be marked.
isCaseSensitive Boolean The markedWord are case sensitive. Defaults to false.
markedWords Array The words in which will be marked.
markerColor String The color of the marker. Defaults to #F6E05E.

License

MIT © DevKosta

Package Sidebar

Install

npm i @devkosta/react-text-marker

Weekly Downloads

0

Version

1.3.0

License

ISC

Unpacked Size

475 kB

Total Files

15

Last publish

Collaborators

  • devkosta