
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
react-lines-ellipsis
Advanced tools
Poor man's multiline ellipsis component for React.JS https://xiaody.github.io/react-lines-ellipsis/
To install the stable version:
npm install --save react-lines-ellipsis
import LinesEllipsis from 'react-lines-ellipsis'
<LinesEllipsis
text='long long text'
maxLine='3'
ellipsis='...'
trimRight
basedOn='letters'
/>
The text you want to clamp.
Max count of lines allowed. Default 1
.
Text content of the ellipsis. Default …
.
Trim right the clamped text to avoid putting the ellipsis on an empty line. Default true
.
Split by letters
or words
. By default it uses a guess based on your text.
lib/html.js
for experimental rich html support::first-letter
, ligatures, etc.import HTMLEllipsis from 'react-lines-ellipsis/lib/html'
<HTMLEllipsis
unsafeHTML='simple html content'
maxLine='5'
ellipsis='...'
basedOn='letters'
/>
import LinesEllipsis from 'react-lines-ellipsis'
import responsiveHOC from 'react-lines-ellipsis/lib/responsiveHOC'
const ResponsiveEllipsis = responsiveHOC()(LinesEllipsis)
// then just use ResponsiveEllipsis
This is a non-standardized css-based solution for some webkit-based browsers. It may have better render performance but also can be fragile. Be sure to test your use case if you use it. See https://css-tricks.com/line-clampin/#article-header-id-0 for some introduction.
import LinesEllipsisLoose from 'react-lines-ellipsis/lib/loose'
<LinesEllipsisLoose
text='long long text'
maxLine='2'
lineHeight='16'
/>
FAQs
Simple multiline ellipsis component for React.JS
The npm package react-lines-ellipsis receives a total of 95,542 weekly downloads. As such, react-lines-ellipsis popularity was classified as popular.
We found that react-lines-ellipsis demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.