1.0.5 • Published 8 months ago

react-native-text-highlighter v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

React Native Text Highlight is a custom component to highlight the searched word in a sentence using the highlight-words-core.

Support

iOS & Android

Installation

npm install react-native-text-highlighter

Note:

You need to make configuration on iOS and Android by following the instruction from the above dependencies libraries.

Usage

import TextHighlight from 'react-native-text-highlighter';

//...

<TextHighlight
  textToHighlight='The quick brown fox jumps over the lazy dog'
  searchWords={["the", "fox"]}
  fontSize={18}
/>

Properties

Basic

PropDefaultTypeOptionalDescription
textToHighlight''stringfalseThe text for the search words to match
searchWords[]arrayfalseThe array of search words
fontSize15numbertrueThe font size of the text
fontFamilynullstringtrueThe font family of the text
numberOfLinesnullnumbertrueThe number of lines to render the text

Custom styles

PropDefaultTypeOptionalDescription
containerStyle{...}styletrueStyle of the container of the text
highlightTextStyle{...}styletrueStyle of the highlighted text
textStyle{...}styletrueStyle of the entire text (highlighted & not highlighted text)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.


Made with create-react-native-library

1.0.5

8 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago