react-text-trimmer
Installation
Install from NPM:
yarn install react-text-trimmer
Usage
Options
lines
: number of lines to truncate text
prefix
: prefix to attach to beginning of text, default is empty string
suffix
: suffix to attach to end of text, default is ...
interval
: dobounce interval, default is 166
There is two ways to use the text trimmer. One can use the component or the react hook.
Components
Props:
options
: TextTrimmerOptions
...<TextTrimmer> Long text.........<TextTrimmer> ...
Hook
...const ref = React const value = return <div ref=ref>value</div> ...
Code Style
This repository is configured with EditorConfig.