
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
react-line-clamp
Advanced tools
A react component which can help you implememt line-clamp automatically
A React Component which can help you clamp Multi-line text.
npm install react-clamp
https://github.com/oglen/react-clamp
require react-clamp to your react component:
import Clamp from 'react-clamp';
Use react-clamp in your component:
class Component extends React.Component {
componentDidMount() {
window && window.addEventListener('resize', event => {
this.refs.aCard.adjustContext();
this.refs.bCard.adjustContext();
this.refs.cCard.adjustContext();
});
}
render() {
return <div className="container">
<div className="grid" id="demo">
<div className="column">
<Clamp className="card" ellipsis="..." ref="aCard">
Brisbane’s Waterfront Place and the Eagle Street Pier retail complex were snapped up by property giant Dexus Property Group and Dexus Wholesale Property Fund for a staggering $635 million.
</Clamp>
</div>
<div className="column">
<Clamp className="card" ellipsis={<span> <a href="#">Read More</a></span>} ref="bCard">
Brisbane’s Waterfront Place and the Eagle Street Pier retail complex were snapped up by property giant Dexus Property Group and Dexus Wholesale Property Fund for a staggering $635 million.
</Clamp>
</div>
</div>
</div>
}
...
}
And set the card style:
.card {
height: 60px;
overflow: hidden;
line-height: 20px;
}
There is a clear and concise example in the repo, preview it in following steps:
Enter this project fold and execute:
npm instasll
gulp
And visit link:
/demo/index.html
FAQs
A react component which can help you implememt line-clamp automatically
The npm package react-line-clamp receives a total of 15 weekly downloads. As such, react-line-clamp popularity was classified as not popular.
We found that react-line-clamp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.