1.6.0 • Published 6 months ago

@vikalp_p/react-native-highlightable-text v1.6.0

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

react-native-highlightable-text

Highlightable React native Text View component, supports text selection and showing highlights.

Demo

Usage

import { HighlightableText } from '@vikalp_p/react-native-highlightable-text';

// Use normally, it is a drop-in replacement for react-native/Text
<HighlightableText
  value={`Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint voluptatibus officiis nisi molestiae officia iure, magnam provident, perspiciatis fugiat ex dolorem! Commodi animi corporis dicta possimus ducimus perferendis, sequi consequuntur?`}
  style={contentStyle}
  highlights={highlights}
  highlightColor={'red'}
  onHighlightPress={onHighlightPress}
  onSelectionChange={onSelectionChange}
/>;

Getting started

$ npm install @vikalp_p/react-native-highlightable-text $ cd ios && pod install

Props

namedescriptiontypedefault
valuetext contentstring""
styleadditional styles to be applied to textObject
highlightsarray of text ranges that should be highlighted with an optional idarray({ id: string, start: int, end: int })[]
highlightColorhighlight colorstring
onSelectionChangeCalled when the text selection changes(event: Selection) => void
onHighlightPresscalled when the user taps the highlight(id: string) => void
appendToChildrenelement to be added in the last line of textReactNode
1.6.0

6 months ago

1.5.3

6 months ago

1.5.2

6 months ago

1.5.1

6 months ago

1.5.0

6 months ago

1.4.4

6 months ago

1.4.3

6 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.3

9 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago