https://github.com/konforti/react-truncate
✂️ Truncate text by number of lines
https://github.com/konforti/react-truncate
clamp elipsis paragraph reactjs string text trimming truncate truncate-text truncation
Last synced: 5 months ago
JSON representation
✂️ Truncate text by number of lines
- Host: GitHub
- URL: https://github.com/konforti/react-truncate
- Owner: konforti
- License: mit
- Created: 2018-07-27T15:13:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-18T12:09:07.000Z (almost 8 years ago)
- Last Synced: 2024-08-10T20:13:06.574Z (almost 2 years ago)
- Topics: clamp, elipsis, paragraph, reactjs, string, text, trimming, truncate, truncate-text, truncation
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@konforti/react-truncate
- Size: 176 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ✂️ React Truncate
> React wrapper for [@konforti/truncate](https://github.com/konforti/truncate)
## ✨ Features
- Truncate text by number of lines.
- Truncate form end, start or middle.
- Responsive truncation.
- Get notified if a text has been truncated or not.
- Custom ellipsis.
## 🔧 Installation
```bash
npm i -S @konforti/react-truncate
```
```bash
yarn add @konforti/react-truncate
```
## 🔧 Usage
```js
import Truncate from '@konforti/react-truncate';
```
## 🔦 Examples
```js
{text}
```
```js
{text}
```
```js
{text}
```
```js
{
if (truncated) {
setState({ truncated: true });
}
}}
>
{text}
```