react-shave
v1.0.1
Published
React component based on the Shave text trimming algorithm.
Maintainers
Readme
React Shave
This component is a simple rewrite of the Shave library.
It allows you to add ellipsis to multi line text.
It doesn't make use of the real Shave library, everything has been re-implemented to
limit the access to the DOM directly to let React manage it.
The component is very small and concise, take a look in the /lib folder. 🙂
Demo
Just a small demo of the component:
http://codepen.io/FezVrasta/pen/PGLVNO
Installation
npm install --save react-shaveor
yarn add react-shaveUsage
<Shave maxHeight={70}>
{someLongTextHere}
</Shave>Properties
React Shave accepts few properties:
maxHeight: required to know the desired max height of the component;tag: by default isp, but you can define any HTML block tag you prefer;character: by default is ellipsis (…) but you can define any string you prefer;
