1.1.8 • Published 4 years ago

text-selection-react v1.1.8

Weekly downloads
85
License
MIT
Repository
-
Last release
4 years ago

Demo

Image of work

text selection react

text selection react module provide the selected text and html on desktop and mobile browser. It also provide the feature to color the selected text/html

Installation

To install this package you have to run

npm install text-selection-react

Real Demo

Link of demo

UPDATE

Now Support Mobile Browser and Can undo selected text

NEXT RELEASE

  1. Improve Remove button style and also add functionality for user to add preffered style to Remove button
  2. Add choise to highlight the selected text or not

Usage

This is a independent module. To use it you don't have to wrap it around any component. You can put it any where in the component or in the file inside render to use this component.

import TextSelector from 'text-selection-react'

    <TextSelector
        events={[
        {
            text: 'Submit',
            handler: this.handler
        }
        ]}
        color={'yellow'}
        colorText={true}
    />

Here In events you can add as many event as you want. like currently i am using only one event then it will be shown as

color :- In color you can add color of you choise

colorText :- if true then it color the selected text

Image of work

so if you click on submit it will change the background of the text into

Image of change background

Mobile View

Image of multi events

Undo selected text Image of multi events

Attribute for Remove/Undo button Image of multi events

you can add as many event as you want in it

like

Image of multi events

this will look like Image of multi events view

Handler

handle will return two params. which are html and text.

Image of return params

Shoutouts

This is written during one of my project in which i have to provide the selected text but i didn't find any library that give you the selected text so i research on it and find this solution uptill now. And will add new function in future as there are many in my mind

Question

if you have any question or want me to add or modify as per your requirement then contact me i will do it for you.

Request

If you like it please give a star on github. Thanks

text selection react

text-selection-react

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.12

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