# ngx-highlight-text

> This package contains an Angular pipe to highlight a word in a given text.

Latest version **1.0.0** (published 2023-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-highlight-text
pnpm add ngx-highlight-text
yarn add ngx-highlight-text
bun add ngx-highlight-text
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-01-22 |
| First published | 2023-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 79.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Balram Chavan |
| Maintainers | ultrasonicsoft |
| Keywords | highlight, angular, keyword, word, color, format, pipe |

## Links

- npm: https://www.npmjs.com/package/ngx-highlight-text
- Repository: https://github.com/ultrasonicsoft/ngx-highlight-text
- Homepage: https://github.com/ultrasonicsoft/ngx-highlight-text#readme
- Issues: https://github.com/ultrasonicsoft/ngx-highlight-text/issues
- npm.io page: https://npm.io/package/ngx-highlight-text

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.10.0

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-01-22
- 0.0.1 — 2023-01-22

## README

# Angular Pipe for highlighting the text in HTML

This package contains an Angular pipe to highlight a word in a given text.

> Note that, this library supports any Angular projects from version 9 onwards till latest version.


## Install

You can get it on npm.

```
npm install ngx-highlight-text --save
```

## Setup

*  Import `NgxHighlightTextModule` into your application `AppModule`

```ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { NgxHighlightTextModule } from 'projects/ngx-highlight-text/src/public-api';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxHighlightTextModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }


```

## Usage - Highlight a word
* Use `innerHTML` property binding of a text element e.g. <p> and pass the source text, word to highlight and optional highlight color. Default highlight color is `yellow`. 


```html
<p [innerHTML]="description | highlight: 'Angular'"></p>
<p [innerHTML]="description | highlight: 'page': 'cyan'"></p>
```

## Example
<img  style="margin-right: 15px" src="https://github.com/ultrasonicsoft/ngx-highlight-text/blob/main/projects/ngx-highlight-text/assets/demo.png?raw=true" >


## License

[MIT License](https://github.com/ultrasonicsoft/ngx-highlight-text/blob/main/license) © Balram Chavan

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