0.0.5 • Published 8 years ago

react-text-highlighting v0.0.5

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

react-text-highlighting

react component to highlight text

Quick Start

npm install react-text-highlighting --save
<TextHighlighting highlightCharsRanges={[{start: 0, end: 5}]}>
  hello world
<TextHighlighting>

<TextHighlighting highlightChars={[0, 2, 4]}>
  hello world
<TextHighlighting>

<TextHighlighting highlight='world'>
  hello world
<TextHighlighting>

You can customize the styling by passing a style object

const STYLES = {
  highlight: {backgroundColor: 'yellow'},
  range: {
    start:   {backgroundColor: 'yellow'},
    between: {backgroundColor: 'yellow'},
    end:     {backgroundColor: 'yellow'}
  }
};

<TextHighlighting styles={STYLES} highlight='world'>
  hello world
<TextHighlighting>

npm.io

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago