An open API service indexing awesome lists of open source software.

https://github.com/markoelez/react-selectable-text

React component providing controlled selection within a text display
https://github.com/markoelez/react-selectable-text

component react

Last synced: 6 months ago
JSON representation

React component providing controlled selection within a text display

Awesome Lists containing this project

README

          

# react-selectable-text

## Install

`npm install react-selectable-text`

## Usage

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

```

## 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)