1.0.8 • Published 4 years ago

react-selectable-text v1.0.8

Weekly downloads
29
License
ISC
Repository
github
Last release
4 years ago

react-selectable-text

Install

npm install react-selectable-text

Usage

const handleSelect = selection => {
	// deal with selection here
}

<SelectableText
	ranges={[
		{ start: 0, end: 50 },
		{ start: 80, end: 120 }
	]}
	selectStyle={{ backgroundColor: '#ffcc80' }}
	text={TEXT_STRING}
	onSelect={handleSelect}
	storeSelect={true}
/>

Props

  • ranges: ranges of text to mark
  • text: text to mark
  • onMouseOverSelection: callback when mouse is over a selection
  • onSelect: callback when a selection is made
  • selectStyle: style for selected text
  • storeSelect: whether to store current selection until new selection is made
  • onEmptySelect: callback for empty click (no text selected)
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago