Truncate
A Truncate component can help you crop multiline text. There will be three dots at the end of the text.
Basic Usage
With the custom ellipsis
With the onTruncate
Example usage in Card
HTML markdown support
Truncate Props API
- children
string
Required RequiredThe expected text to which the ellipsis would be applied.
- lines
string
Required |number
Required RequiredDefault1The number of lines the text to be truncated to.
- ellipsis
string
Required |number
Required |node
Required RequiredDefault'...'Text content for the ellipsis - will appear after the truncated lines.
- whiteSpace
bool
RequiredDefaultfalseAdds the whitespace from before the ellipsis.
- elementType
string
RequiredDefault'div'Custom html element for truncated text.
- className
string
RequiredSpecifies class name to append to the base element.
- onTruncate
func
RequiredCallback fired when a text truncating