chop-lines
v1.15.7
Published
A React component which truncates lines of HTML.
Downloads
1,921
Maintainers
Readme
ChopLines
ChopLines is a lightweight React component which truncates multiple lines of HTML markup.

Installation
Add the dependency:
yarn add chop-linesAnd 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 & linesHeight are not set | | ellipsis | ReactNode or ReactElement<any> | Optional (default: "…") | | children | ReactNode or ReactElement<any> | required |
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 commitizenWhen you are ready to commit your changes…
git add .
git czThen, 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 testAdditional Commands
Keep things tidy
yarn lintTest that your changes compile
yarn buildLicense
MIT
