You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@re-dev/react-truncate

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@re-dev/react-truncate

Provides `Truncate`, `MiddleTruncate` and `ShowMore` React components for truncating multi-line spans and adding an ellipsis.

0.5.1
latest
Source
npmnpm
Version published
Weekly downloads
12K
-5.45%
Maintainers
1
Weekly downloads
 
Created
Source

@re-dev/react-truncate

@re-dev/react-truncate

Test Coverage GitHub stars



English | 简体中文

Provides Truncate, MiddleTruncate and ShowMore React components for truncating multi-line spans and adding an ellipsis.

Installation

With npm(or yarn, or pnpm):

npm install @re-dev/react-truncate

Documentation

  • Truncate

A basic component for cropping text. Usually there is no need to use it directly. <ShowMore /> and <MiddleTruncate /> provided by this package are both extended based on this component.

A "Show More" component, when the content exceeds the set number of display lines, an expand button will appear to view more content.

A "middle ellipsis" component, when the content exceeds the limit of the parent's width, an ellipsis symbol will appear (similar to CSS's text-overflow: ellipsis effect), but its omission position can be specified in the middle of the text instead of the end.

Release Notes

Please refer to CHANGELOG for details.

License

MIT License © 2023-PRESENT chengpeiquan

Keywords

react

FAQs

Package last updated on 31 Mar 2025

Did you know?

Socket

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.

Install

Related posts