1# polygon
2
3
4>  **NOTE**
5>
6>  This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
7
8The **\<polygon>** component is used to draw a polygon.
9
10
11## Required Permissions
12
13None
14
15
16## Child Components
17
18The following are supported: [\<animate>](js-components-svg-animate.md), [\<animateMotion>](js-components-svg-animatemotion.md), and [\<animateTransform>](js-components-svg-animatetransform.md).
19
20
21## Attributes
22
23The [universal attributes](js-components-svg-common-attributes.md) and the attributes listed below are supported.
24
25| Name| Type| Default Value| Mandatory| Description|
26| -------- | -------- | -------- | -------- | -------- |
27| id | string | - | No| Unique ID of the component.|
28| points | string | - | No| Multiple coordinates of the polygon.<br>The format is [x1,y1 x2,y2 x3,y3].<br>Attribute animations are supported. If the number of coordinates of the animation change value set in the attribute animation is different from the format of the original points, the attribute animation is invalid.|
29
30
31## Example
32
33```html
34<!-- xxx.hml -->
35<div class="container">
36  <svg fill="white" stroke="blue" width="400" height="400">
37    <polygon points="10,110 60,35 60,85 110,10" fill="red"></polygon>
38    <polygon points="10,200 60,125 60,175 110,100" stroke-dasharray="10 5" stroke-dashoffset="3"></polygon>
39  </svg>
40</div>
41```
42
43
44![en-us_image_0000001173324721](figures/en-us_image_0000001173324721.png)
45