# chop-lines

> A React component which truncates lines of HTML.

Latest version **1.15.7** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install chop-lines
pnpm add chop-lines
yarn add chop-lines
bun add chop-lines
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.15.7 |
| Published | 2020-04-14 |
| First published | 2019-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Douglas Waltman II |
| Maintainers | dw2 |
| Keywords | react, truncate, ellipsis, multiline, markup, typescript |

## Links

- npm: https://www.npmjs.com/package/chop-lines
- Repository: https://github.com/dw2/chop-lines
- Homepage: https://github.com/dw2/chop-lines#readme
- Issues: https://github.com/dw2/chop-lines/issues
- npm.io page: https://npm.io/package/chop-lines

## Dependencies (1)

- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8

## 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

- 1.15.7 (latest) — 2020-04-14
- 1.15.6 — 2020-04-14
- 1.15.5 — 2020-04-14
- 1.15.4 — 2020-04-14
- 1.15.3 — 2020-04-14
- 1.15.2 — 2020-04-14
- 1.15.1 — 2020-04-14
- 1.15.0 — 2020-04-14
- 1.14.1 — 2019-10-02
- 1.14.0 — 2019-09-26
- 1.13.5 — 2019-09-26
- 1.13.4 — 2019-02-28
- 1.13.3 — 2019-02-28
- 1.13.2 — 2019-02-28
- 1.13.1 — 2019-02-28
- … 13 more at https://npm.io/package/chop-lines/versions

## README

# ChopLines
ChopLines is a lightweight React component which truncates multiple lines of HTML markup.

![](https://badgen.net/github/release/dw2/chop-lines) [![CircleCI](https://circleci.com/gh/dw2/chop-lines.svg?style=svg)](https://circleci.com/gh/dw2/chop-lines) ![](https://badgen.net/badgesize/gzip/https://unpkg.com/chop-lines) ![Codecov](https://codecov.io/gh/dw2/chop-lines/branch/master/graph/badge.svg)

![choplines-responsive](https://user-images.githubusercontent.com/746347/52906636-bdf94a00-3204-11e9-8fb4-03aab71e70b8.gif)

## Installation
Add the dependency:
```
yarn add chop-lines
```
And then in your component(s):
```
import ChopLines from 'chop-lines';
```

## Props
| Prop | Type | Requirement |
| ---- | ---- | ----------- |
| **lines** | number | required if maxHeight is not set |
| **lineHeight** | number | required if maxHeight is not set |
| **maxHeight** | number | required if lines &amp; linesHeight are not set |
| **ellipsis** | ReactNode or ReactElement&lt;any&gt; | Optional (default: "&hellip;") |
| **children** | ReactNode or ReactElement&lt;any&gt; | required |

## [Implementation Example &rsaquo;](https://github.com/dw2/chop-lines/wiki/Implementation-Example)

## Requirements
 + React 16.9+

---

## Contributing
ChopLines follows semantic release versioning with Commitizen.

### Committing
Install commitizen globally, if you have not already.
```
npm install -g commitizen
```
When you are ready to commit your changes&hellip;
```
git add .
git cz
```
Then, follow the CLI wizard.

**Note:** *Choosing 'feat' or adding 'BREAKING CHANGE' in the commit will
result in a major version bump during the release.*

### Testing
```
nvm use
yarn
yarn test
```

### Additional Commands
Keep things tidy
```
yarn lint
```

Test that your changes compile
```
yarn build
```

## License
MIT

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