# react-best-highlight-text

> A react highlight text component. Support case setting, global render setting and custom class config setting.

Latest version **2.3.6** (published 2018-01-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-best-highlight-text
pnpm add react-best-highlight-text
yarn add react-best-highlight-text
bun add react-best-highlight-text
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.6 |
| Published | 2018-01-14 |
| First published | 2018-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | leeowenowen@gmail.com |
| Maintainers | leeowenowen |
| Keywords | react, hightlight, text |

## Links

- npm: https://www.npmjs.com/package/react-best-highlight-text
- Repository: https://github.com/leeowenowen/js-react-highlight-text
- Homepage: https://github.com/leeowenowen/js-react-highlight-text#readme
- Issues: https://github.com/leeowenowen/js-react-highlight-text/issues
- npm.io page: https://npm.io/package/react-best-highlight-text

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.3.6 (latest) — 2018-01-14
- 2.2.6 — 2018-01-14
- 2.2.4 — 2018-01-14
- 2.2.3 — 2018-01-14
- 2.2.2 — 2018-01-14
- 2.2.1 — 2018-01-14
- 1.0.1 — 2018-01-14
- 1.0.0 — 2018-01-14

## README

# js-react-highlight-text
A Hight light Text React Component

## Support props
| params        | type           | note       |
| ------------- |:-------------|:-------------| 
|normalTextClsName| string | class name for normal text.|  
|highlightTextClsName| string | class name for highlight text. |
|text| string | text this component to display |
|keyword | string | keyword this component to highlight display |
|ignoreCase | boolean | ignore case while doing keyword match |
|highlightAllMatch | boolean | search and highlight all matched keywords, if not specified, only the first matched keywords will matched|

## Usage
![](https://github.com/leeowenowen/js-react-highlight-text/blob/master/wiki-res/highlightText.png?raw=true)

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

```css
.normalText {
  font-size: 12px;
  color:yellow;
}
.highlightText {
  font-size: 18px;
  color: red;
  font-weight: bold;
}
```

```javascript
       <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>
```

---
_Source: https://npm.io/package/react-best-highlight-text · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
