2.3.6 • Published 6 years ago

react-best-highlight-text v2.3.6

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

js-react-highlight-text

A Hight light Text React Component

Support props

params      type          note
normalTextClsNamestringclass name for normal text.
highlightTextClsNamestringclass name for highlight text.
textstringtext this component to display
keywordstringkeyword this component to highlight display
ignoreCasebooleanignore case while doing keyword match
highlightAllMatchbooleansearch and highlight all matched keywords, if not specified, only the first matched keywords will matched

Usage

npm.io

Above shows the display result of this component. Code is as belows

.normalText {
  font-size: 12px;
  color:yellow;
}
.highlightText {
  font-size: 18px;
  color: red;
  font-weight: bold;
}
       <div> 
        Highlight first: &nbsp;
        <HLText
          normalTextClsName="normalText"
          highlightTextClsName="highlightText"
          text="AaBbCAd"
          keyword="a"
        />
        </div>
       <div> 
        Highlight first and ignore case: &nbsp;
        <HLText
          normalTextClsName="normalText"
          highlightTextClsName="highlightText"
          text="AaBbCAd"
          keyword="a"
          ignoreCase
        />
        </div>
       <div> 
        Highlight all and ignore case: &nbsp;
        <HLText
          normalTextClsName="normalText"
          highlightTextClsName="highlightText"
          text="AaBbCAd"
          keyword="a"
          ignoreCase
          highlightAllMatch
        />
        </div>
2.3.6

6 years ago

2.2.6

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago