Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-ellipsis-text
Advanced tools
React text ellipsify component
npm install --save react-ellipsis-text
EllipsisText
EllipsisText.propTypes = {
text: PropTypes.string.isRequired,
length: PropTypes.number.isRequired,
tail: PropTypes.string,
tailClassName: PropTypes.string,
tooltip: PropTypes.shape({
copyOnClick: PropTypes.bool,
onAppear: PropTypes.func,
onDisapepear: PropTypes.func
})
};
text
: Text to display
length
: Max length of text
tail
: Trailing string (Default '...')
tailClassName
: Trailing string element's class name
tooltip
: Tooltip will be display when supplied
tooltip.clipboard
: Original text will be copied into clipboard when tooltip is clicked.
tooltip.onAppear
: Called when tooltip is shown.
tooltip.onDisapepear
: Called when tooltip is hidden.
"use strict";
import React from "react";
import EllipsisText from "react-ellipsis-text";
//allow react dev tools work
window.React = React;
class App extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<EllipsisText text={"1234567890"} length={"5"} />
</div>
);
}
}
React.render(<App />, document.getElementById("out"));
// It will be
// <div>
// <span><span>12</sapn><span class='more'>...</span></span>
// </div>
//
See example
npm install
npm run start:example
npm run test:local
Ver 1.2.1
ncu -u
FAQs
React component which ellipsis text
We found that react-ellipsis-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.