text highlighter
text highlighter... :)
Installation
npm i lifeweb-text-highlighter
Usage
import Highlighter from 'lifeweb-text-highlighter'
<Highlighter
searchWords = {[{text: "test", style: {backgroundColor: 'yellow'}}]}
textToHighlight = {"this is a test"}
/>
Props
Attribute | type | default |
---|---|---|
caseSensitive | boolean |
false |
searchWords | PatternItem[] |
[] |
textToHighlight | string |
'' |
globalClassName | string |
null |
globalStyle | CSSProperties |
null |
globalOnClick | function |
null |
Pattern Item
Attribute | type | default |
---|---|---|
text | RegExp string
|
`` |
className | string |
null |
style | CSSProperties |
{background : yellow } |
onClick | function |
null |
render | function |
null |
License
MIT
author
Nafiseh Mahdianfar nama996
[Lifeweb Company] lifeweb.webapp@gmail.com