Small library for highlighting text in react-native.
npm install react-native-text-highlight --save
import TextHighlight from 'react-native-text-highlight';
...
<TextHighlight
highlight="code"
highlightStyle={{
color: 'green'
}}
style={{
color: 'red'
}}
>
People love to code in javascript.
</TextHighlight>
Property | Description | default |
---|---|---|
highlight | The key that will be searched for in the str. | null |
caseSensitive | Determines if the search should be case sensitive | false |
- str: "People love to code in javascript."
- highlight: "code"
- caseSentive: false
- Result: "People love to code in javascript."
- 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.