Skip to content
On this page

NcHighlight

Props

Prop nameDescriptionTypeValuesDefault
textThe string to displaystring-''
searchThe string to match and highlightstring-''
highlightThe ranges to highlight, takes precedence over the search prop.array-[]

General description

Highlight a string with html <strong>. Accepts a substring to highlight or an array with ranges.

Usage

vue
<template>
  <div>
    <NcHighlight text="Highlight me please!" search="me" />
    <br />
    <NcHighlight
      text="Highlight me please!"
      :highlight="[{ start: 4, end: 12 }]"
    />
  </div>
</template>