1.0.1 • Published 8 years ago

react-native-text-highlight v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

react-native-text-highlight

Small library for highlighting text in react-native.

Installation

npm install react-native-text-highlight --save

Usage

import TextHighlight from 'react-native-text-highlight';
...
<TextHighlight
  highlight="code"
  highlightStyle={{
    color: 'green'
  }}
  style={{
    color: 'red'
  }}
>
  People love to code in javascript.
</TextHighLight>
PropertyDescriptiondefault
highlightThe key that will be searched for in the str.null
caseSensitiveDetermines if the search should be case sensitivefalse

Examples

  • str: "People love to code in javascript."
  • highlight: "code"
  • caseSentive: false
  • Result: "People love to code in javascript."

Todo

  • Change the component to accept the str as a child to the component instead of property.
  • Add an Example project.
  • Add Screenshot of the component being used.