Skip to content

IgxTextHighlight Directive

Dimitar Davidkov edited this page Apr 16, 2018 · 6 revisions

Overview

IgxTextHighlightDirective provides a way to highlight text elements.

<div [igxTextHighlight]="highlightClass">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>

User Stories

Developer

  • As a developer I want to be able to highlight parts of the text in a certain element.
  • As a developer I want to be able to customize how the highlight looks like.

End User

  • As an end user I would like to be able to highlight part of the application, so certain text elements stand out from the rest of the text.

Integration scenarios

The highlight directive will be used to highlight searched strings in the IgxGridComponent.

API

Inputs

Name Type Description
className string Determines the CSS class of the highlight elements, allowing the developer to provide custom CSS to customize the highlight.

Methods

Name Type Arguments Description
highlight number The text that should be highlighted and, optionally, if the search should be case sensitive or not (it defaults to false if it isn't specified). Clears the existing highlight and highlight the searched text. Returns how many times the element contains the searched text.
clearHighlight void N/A Clears any existing highlight
Clone this wiki locally