# react-text-truncate

> Truncate text for React.js

Latest version **0.19.0** (published 2022-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-text-truncate
pnpm add react-text-truncate
yarn add react-text-truncate
bun add react-text-truncate
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.19.0 |
| Published | 2022-06-07 |
| First published | 2015-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-text-truncate) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 595.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 325 |
| Author | ShinyChang |
| Maintainers | shinychang |
| Keywords | react, react-component, text, truncate |

## Links

- npm: https://www.npmjs.com/package/react-text-truncate
- Repository: https://github.com/ShinyChang/react-text-truncate
- Issues: https://github.com/ShinyChang/react-text-truncate/issues
- npm.io page: https://npm.io/package/react-text-truncate

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.7

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.19.0 (latest) — 2022-06-07
- 0.18.0 — 2022-02-21
- 0.17.0 — 2021-07-15
- 0.16.0 — 2020-01-08
- 0.15.0 — 2019-07-31
- 0.14.1 — 2019-04-05
- 0.14.0 — 2019-02-26
- 0.13.1 — 2018-03-24
- 0.13.0 — 2018-03-24
- 0.12.1 — 2017-12-27
- 0.12.0 — 2017-09-25
- 0.11.2 — 2017-07-23
- 0.11.1 — 2017-07-23
- 0.11.0 — 2017-07-10
- 0.10.4 — 2017-07-07
- … 36 more at https://npm.io/package/react-text-truncate/versions

## README

# React-Truncate-Text [![npm version](https://badge.fury.io/js/react-text-truncate.svg)](https://badge.fury.io/js/react-text-truncate)

## Install

```
npm install react-text-truncate
```

## Usage

```js
import TextTruncate from 'react-text-truncate'; // recommend
var TextTruncate = require('react-text-truncate'); // CommonJS or UMD
```

## Markup

```jsx
<TextTruncate
    line={1}
    element="span"
    truncateText="…"
    text="Lorem Ipsum is simply dummy text of the printing and typesetting industry."
    textTruncateChild={<a href="#">Read on</a>}
/>
```

[Demo](http://shinychang.github.io/React-Text-Truncate/)

## FAQ

1. Why TextTruncate not shown after display changed?

    You must trigger update manually.

2. Will TextTruncate support IE10 or below?

    No! IE 10 and below are dead according to [Microsoft post](https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support).

---
_Source: https://npm.io/package/react-text-truncate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
