React component for truncating multi-line spans and adding an ellipsis.
This is a Fork version from react-truncate . Since the original version has not been maintained for a long time, we plan to solve existing problems through this repository.
With npm(or yarn, or pnpm):
npm install @re-dev/react-truncate
In .jsx
/ .tsx
or other files:
import { MiddleTruncate, Truncate, ShowMore } from '@re-dev/react-truncate'
Normally, you only need to use the MiddleTruncate
or ShowMore
component.
See: Basic Example
New documentation coming soon, please refer to the legacy version for now.
See:
Please refer to CHANGELOG for details.
Here are some recent development plans.
If you have good ideas and suggestions, you can provide feedback through issue.
See: Projects on GitHub .
MIT License © 2023-PRESENT chengpeiquan