# text > **NOTE** > > - This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > > - The text content must be written in the content area. The **tspan** sub-element label can be nested to segment the text content. The **textPath** sub-element label can be nested to draw the text content based on the specified path. > > - **\** can be nested only by the parent element label **svg**. > > - Only the default font **sans-serif** is supported. The **\** component is used to display a piece of textual information. ## Required Permissions None ## Child Components The following are supported: [\](js-components-svg-tspan.md), [\](js-components-svg-textpath.md), [\](js-components-svg-animate.md), and [\](js-components-svg-animatetransform.md). ## Attributes The attributes in the following table are supported. | Name | Type | Default Value | Mandatory | Description | | -------------- | ---------------------------------- | ----- | ---- | ---------------------------------------- | | id | string | - | No | Unique ID of the component. | | x | <length> \| <percentage> | 0 | No | X-coordinate of the upper left corner of the component. | | y | <length> \| <percentage> | 0 | No | Y-coordinate of the upper left corner of the component. | | dx | <length> \| <percentage> | 0 | No | Offset of the text on the x-axis. | | dy | <length> \| <percentage> | 0 | No | Offset of the text on the y-axis. | | rotate | number | 0 | No | Rotation of the text around its lower left corner. A positive number indicates clockwise rotation, and a negative number indicates counterclockwise rotation. | | font-size | <length> | 30px | No | Font size. | | fill | <color> | black | No | Fill color of the text. | | fill-opacity | number | 1.0 | No | Fill opacity of the text. | | opacity | number | 1 | No | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. Attribute animations are supported.| | stroke | <color> | black | No | Stroke color. | | stroke-width | number | 1px | No | Stroke width. | | stroke-opacity | number | 1.0 | No | Stroke opacity. | ## Example ```css /* xxx.css */ .container { flex-direction: row; justify-content: flex-start; align-items: flex-start; height: 1000px; width: 1080px; } ``` ```html
test x|y test x|y test opacity test dx|dy|fill|font-size test fill-opacity test 0123456789 Test test rotate test stroke test stroke-opacity
``` ![text-part1](figures/text-part1.png) Attribute animation example ```css /* xxx.css */ .container { flex-direction: row; justify-content: flex-start; align-items: flex-start; height: 3000px; width: 1080px; } ``` ```html
text attribute x|opacity|rotate
``` ![text-animate-part1](figures/text-animate-part1.gif) ```html
text attribute font-size
``` ![text-animate-part2](figures/text-animate-part2.gif) ```html
text attribute stroke text attribute stroke-width-opacity
``` ![text-animate-part3](figures/text-animate-part3.gif)