1e41f4b71Sopenharmony_ci# line 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci> **NOTE** 5e41f4b71Sopenharmony_ci> 6e41f4b71Sopenharmony_ci> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciThe **\<line>** component is used to draw a line. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## Required Permissions 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ciNone 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## Child Components 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciThe following are supported: [animate](js-components-svg-animate.md), [animateMotion](js-components-svg-animatemotion.md), and [animateTransform](js-components-svg-animatetransform.md). 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci## Attributes 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ciThe [universal attributes](js-components-svg-common-attributes.md) and the attributes listed below are supported. 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description| 25e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 26e41f4b71Sopenharmony_ci| id | string | - | No| Unique ID of the component.| 27e41f4b71Sopenharmony_ci| x1 | <length>\|<percentage> | - | No| X-coordinate of the start point of the line. Attribute animations are supported.| 28e41f4b71Sopenharmony_ci| y1 | <length>\|<percentage> | - | No| Y-coordinate of the start point of the line. Attribute animations are supported.| 29e41f4b71Sopenharmony_ci| x2 | <length>\|<percentage> | - | No| X-coordinate of the end point of the line. Attribute animations are supported.| 30e41f4b71Sopenharmony_ci| y2 | <length>\|<percentage> | - | No| Y-coordinate of the end point of the line. Attribute animations are supported.| 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci## Example 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci```html 36e41f4b71Sopenharmony_ci<!-- xxx.hml --> 37e41f4b71Sopenharmony_ci<div class="container"> 38e41f4b71Sopenharmony_ci <svg width="400" height="400"> 39e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="50" y2="50" stroke-width="4" fill="white" stroke="blue"></line> 40e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="100" y2="100" stroke-width="4" fill="white" stroke="blue"></line> 41e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="150" y2="150" stroke-width="10" stroke="red" stroke-dasharray="5 3" 42e41f4b71Sopenharmony_ci stroke-dashoffset="3"></line> 43e41f4b71Sopenharmony_ci <!--round: At the end of each path the stroke is extended by a half circle with a diameter equal to the stroke width. --> 44e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="200" y2="200" stroke-width="10" stroke="black" stroke-linecap="round"></line> 45e41f4b71Sopenharmony_ci <!--butt: The stroke for each path does not extend beyond its two endpoints. --> 46e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="220" y2="220" stroke-width="10" stroke="black" stroke-linecap="butt"></line> 47e41f4b71Sopenharmony_ci <!-- square: At the end of each path the stroke is extended by a half circle, with the width being equal to half of the stroke width, and the height being equal to the stroke width. --> 48e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="240" y2="240" stroke-width="10" stroke="black" stroke-linecap="square"></line> 49e41f4b71Sopenharmony_ci </svg> 50e41f4b71Sopenharmony_ci</div> 51e41f4b71Sopenharmony_ci``` 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci 55