Skip to content

IgxTextHighlight Directive

Dimitar Davidkov edited this page May 10, 2018 · 6 revisions

Contents

  1. Overview
  2. User Stories
  3. API
  4. Test Scenarios
  5. Limitations

IgxTextHighlightDirective provides a way to highlight text elements.

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

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.

Inputs

Name Type Description
cssClass string Determines the CSS class of the highlight elements, allowing the developer to provide custom CSS to customize the highlight.
activeCssClass string Determines the CSS class of the active highlight element, allowing the developer to provide custom CSS to customize the active highlight.
groupName string Identifies the highlight within a unique group, allowing to have several different highlight groups each having their own active highlight.
value any The underlying value of the element that will be highlighted
row number The index of the row on which the directive is currently on
column number The index of the column on which the directive is currently on
page number The index of the page on which the directive is currently on (used when the component containing the directive supports paging)

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
activateIfNecessary void N/A Activates the highlight if it is on the currently active row, column and page

Automation

Clone this wiki locally