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

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

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}

```