| content | string | No | '' | Text content, which is the content of the child component **<Span>**. This parameter does not take effect when the child component **<Span>** is contained. |
| content | string | No| '' | Text content. This parameter does not take effect when the child component **\<Span>** is contained.|
## Attributes
## Attributes
| Name | Type | Default Value | Description |
| Name| Type| Default Value| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| textAlign | TextAlign | TextAlign.Start | Text alignment mode of multiple lines of text. |
| textAlign | TextAlign | TextAlign.Start | Text alignment mode of multiple lines of text.|
| textOverflow | {overflow: TextOverflow} | {overflow: TextOverflow.Clip} | Display mode when the text is too long. |
| textOverflow | {overflow: TextOverflow} | {overflow: TextOverflow.Clip} | Display mode when the text is too long.<br>**NOTE**<br>Text is truncated at the transition between words. To truncate text in the middle of a word, add **\u200B** between characters. |
| maxLines | number | Infinity | Maximum number of lines in the text. |
| maxLines | number | Infinity | Maximum number of lines in the text.|
| lineHeight | Length | - | Text line height. If the value is less than or equal to **0**, the line height is not limited and the font size is adaptive. If the value of the number type, the unit fp is used. |
| lineHeight | Length | - | Text line height. If the value is less than or equal to **0**, the line height is not limited and the font size is adaptive. If the value of the number type, the unit fp is used.|
| decoration | {<br/>type: TextDecorationType,<br/>color?: Color<br/>} | {<br/>type: TextDecorationType.None,<br/>color: Color.Black<br/>} | Style and color of the text decorative line. |
| decoration | {<br>type: TextDecorationType,<br>color?: Color<br>} | {<br>type: TextDecorationType.None,<br>color: Color.Black<br>} | Style and color of the text decorative line.|
| baselineOffset | Length | - | Offset of the text baseline. |
| baselineOffset | Length | - | Offset of the text baseline.|
| textCase | TextCase | TextCase.Normal | Text case. |
| textCase | TextCase | TextCase.Normal | Text case.|
| copyOption<sup>9+</sup> | boolean\|CopyOption | false | Whether copy and paste is allowed.|
- TextAlign enums
- TextAlign enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Center | The text is center-aligned.|
| Center | The text is center-aligned.|
| Start | The text is aligned with the direction in which the text is written.|
| Start | The text is aligned with the direction in which the text is written.|
| End | The text is aligned with the opposite direction in which the text is written.|
| End | The text is aligned with the opposite direction in which the text is written.|
- TextOverflow enums
- TextOverflow enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Clip | Extra text is truncated.|
| Clip | Extra text is truncated.|
| Ellipsis | The ellipsis (...) is used for extra-long text. |
| Ellipsis | An ellipsis (...) is used to represent clipped text.|
| None | No truncation or ellipsis is used for extra-long text.|
| None | No truncation or ellipsis is used for extra-long text.|
- TextDecorationType enums
- TextDecorationType enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Underline | An underline is used. |
| Underline | Line under the text.|
| LineThrough | A strikethrough is used. |
| LineThrough | Line through the text.|
| Overline | An overline is used. |
| Overline | Line over the text.|
| None | No decorative line is used. |
| None | No decorative lines.|
- TextCase enums
- TextCase enums
| Name | Description |
| Name | Description |
| --------- | -------------------- |
| Normal | The original case of the text is retained.|
| LowerCase | All letters in the text are in lowercase. |
| UpperCase | All letters in the text are in uppercase. |
- CopyOption<sup>9+</sup> enums
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Normal | The original case of the text is retained. |
| InApp | Intra-application copy and paste is allowed.|
| LowerCase | All letters in the text are in lowercase. |
| LocalDevice | Intra-device copy and paste is allowed.|
| UpperCase | All letters in the text are in uppercase. |
| CrossDevice | Cross-device copy and paste is allowed.|
> The **<Text>** component cannot contain both the text and the child component **<Span>**. If both of them exist, only the content in **<Span>** is displayed.
> If the **\<Text>** component contains both the text and the **\<Span>** child component, only the content in **\<Span>** is displayed.
## Example
## Example
```ts
```
// xxx.ets
@Entry
@Entry
@Component
@Component
structTextExample1{
structTextExample1{
...
@@ -93,7 +102,7 @@ struct TextExample1 {
...
@@ -93,7 +102,7 @@ struct TextExample1 {
Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to Clip text content.')
Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to Clip text content.')