Package Exports
- react-lines-ellipsis
- react-lines-ellipsis/lib/html
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-lines-ellipsis) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-lines-ellipsis
Poor man's multiline ellipsis component for React.JS
Installation
To install the stable version:
npm install --save react-lines-ellipsisUsage
import LinesEllipsis from 'react-lines-ellipsis'
<LinesEllipsis
text="long long text"
maxLine="3"
ellipsis="..."
trimRight
/>Limitations
- only accept plain text by default. use
lib/html.jsfor experimental rich html support - can be fooled by some styles:
::first-letter, italic fonts, etc. - require modern browsers env
Experimental html truncation
import HTMLEllipsis from 'react-lines-ellipsis/lib/html'
<HTMLEllipsis
unsafeHTML="simple html content"
maxLine="5"
ellipsis="..."
/>Dev TODOs
- demo page
- test cases
- improve performance