Truncate
A Truncate component can help you crop multiline text. There will be three dots at the end of the text.
Basic Usage
Show editable code example
Any Paragon component or export may be added to the code example.
With the custom ellipsis
Show editable code example
Any Paragon component or export may be added to the code example.
With the onTruncate
Show editable code example
Any Paragon component or export may be added to the code example.
Example usage in Card
Show editable code example
Any Paragon component or export may be added to the code example.
HTML markdown support
Note: Truncate supports only plain HTML children and not jsx.
QUESTION FOR KEVIN: Would this fail screen readers anyway?
Show editable code example
Any Paragon component or export may be added to the code example.
Props API#
Truncate Props API
- children
React.ReactNodeRequiredThe expected text to which the ellipsis would be applied.
- lines
numberDefault1The number of lines the text to be truncated to.
Usage Insights#
Truncate
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-admin-portal | 21.13.1 | 3 | |
| frontend-app-course-authoring | 22.8.1 | 14 | |
| frontend-app-learner-portal-enterprise | 21.13.1 | 18 |