Skip to content

yantakus/react-highlighter-lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version Build Status

react-highlighter

Highlight select fragments of a string using an HTML element and/or a class.

Installation

npm install react-highlighter --save

Usage

var Highlight = require('react-highlighter');

<Highlight search="brown">The quick brown fox jumps over the lazy dog</Highlight>

Props

  • search: The string of text (or Regular Expression) to highlight
  • caseSensitive: Determine whether string matching should be case-sensitive. Not applicable to regular expression searches. Defaults to false
  • matchElement: HTML tag name to wrap around highlighted text. Defaults to strong
  • matchClass: HTML class to wrap around highlighted text. Defaults to highlight

Development

Testing

Using Mocha/Chai/React.addons.TestUtils for testing.

npm test

About

React highlighter

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%