0.1.0 • Published 6 years ago

react-clampio v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

react-clampio

React component for clamping lines. It adds ellipsis if text exceeds the defined max lines value

Getting started

Install package using yarn or npm

$ yarn add react-clampio
$ npm install react-clampio --save

Pass to the component text that should be truncated:

import Clampio from 'react-clampio';

...

const longText = 'Lorem ipsum ...';
<Clampio
  text={longText}
  lines={3}
/>

Props

NameTypeRequiredDescription
textstringtrueText to truncate
linesnumberfalseMaximum lines (default 2)
ellipsisstringfasleSymbol at the end of truncated text (default ...)
classNamestringfalseCustom classname