1.3.0 • Published 4 years ago
@clampy-js/react-clampy v1.3.0
@clampy-js/react-clampy
React component that clamps the content of an element by adding an ellipsis to it if the content inside is too long.
It uses @clampy-js/clampy library (a fork of Clamp.js) behind the scene to apply the ellipsis.
It automatically re-clamps itself when the element or the browser window change size.
Install
npm install --save @clampy-js/react-clampy
Usage
import React, { Component } from 'react'
import Clampy from '@clampy-js/react-clampy'
class Clampy extends Component {
render () {
return (
<Clampy clampSize="2">My long text to clamp</Clampy>
)
}
}
License
MIT © alexandremoore