Overview
Truncates the text to a certain number of lines and adds an ellipsis character "…".
This is a long text that will be truncated to two line. This is a long text that will be truncated to two line. This is a long text that will be truncated to two line. This is a long text that will be truncated to two line. This is a long text that will be truncated to two line.
Usage
By default, text truncates to one line.
Customizing the number of lines
Use maxLines
to control the number of lines before truncation.
This text is too long to fit in the available space. It truncates after three lines instead of two.This text is too long to fit in the available space. This text truncates after three lines instead of two.This text is too long to fit in the available space.This text truncates after three lines instead of two.This text is too long to fit in the available space. It truncates after three lines instead of two.
<KTextTruncator
text="This text is too long to fit in the available space. It truncates after three lines instead of two.This text is too long to fit in the available space. This text truncates after three lines instead of two.This text is too long to fit in the available space.This text truncates after three lines instead of two.This text is too long to fit in the available space. It truncates after three lines instead of two."
:maxLines="3"
/>
Props
Name | Description | Type | Default | Required |
---|---|---|---|---|
text | Text to be truncated | string | — | true |
maxLines | Maximum number of lines to be shown | number |
1
| — |