提交 93f43ba3 编写于 作者: E ester.zhou

Update docs (1027)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 b53939eb
# chart<a name="EN-US_TOPIC_0000001127125088"></a> # chart
The **<chart\>** component displays line charts, gauge charts, and bar charts. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<chart>** component displays line charts, gauge charts, and bar charts.
None ## Required Permissions
## Child Component<a name="section9288143101012"></a>
Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row176434366222"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p157531437142216"><a name="p157531437142216"></a><a name="p157531437142216"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p975314374228"><a name="p975314374228"></a><a name="p975314374228"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p2753113711229"><a name="p2753113711229"></a><a name="p2753113711229"></a>line</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p117532375222"><a name="p117532375222"></a><a name="p117532375222"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p12753143712225"><a name="p12753143712225"></a><a name="p12753143712225"></a>Chart type. Dynamic modification is not supported. Available values include:</p>
<a name="ul2754143714229"></a><a name="ul2754143714229"></a><ul id="ul2754143714229"><li><strong id="b380817522531"><a name="b380817522531"></a><a name="b380817522531"></a>bar</strong>: bar chart</li><li><strong id="b47791053195316"><a name="b47791053195316"></a><a name="b47791053195316"></a>line</strong>: line chart</li><li><strong id="b10329326115314"><a name="b10329326115314"></a><a name="b10329326115314"></a>gauge</strong>: gauge chart</li><li><strong id="b118466531142"><a name="b118466531142"></a><a name="b118466531142"></a>progress</strong><sup id="sup116561549162915"><a name="sup116561549162915"></a><a name="sup116561549162915"></a>5+</sup>: circle chart of progresses</li><li><strong id="b91066210159"><a name="b91066210159"></a><a name="b91066210159"></a>loading</strong><sup id="sup1246145116541"><a name="sup1246145116541"></a><a name="sup1246145116541"></a>5+</sup>: circle chart of loading processes</li><li><strong id="b187912701513"><a name="b187912701513"></a><a name="b187912701513"></a>rainbow</strong><sup id="sup13727185218542"><a name="sup13727185218542"></a><a name="sup13727185218542"></a>5+</sup>: circle chart of proportions</li></ul>
</td>
</tr>
<tr id="row38691133172215"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p4754173712219"><a name="p4754173712219"></a><a name="p4754173712219"></a>options</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1675423715225"><a name="p1675423715225"></a><a name="p1675423715225"></a><a href="#table12775365017">ChartOptions</a></p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p27541437112214"><a name="p27541437112214"></a><a name="p27541437112214"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1475493712214"><a name="p1475493712214"></a><a name="p1475493712214"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p19754143732218"><a name="p19754143732218"></a><a name="p19754143732218"></a>Chart parameters. You must set parameters for bar charts and line charts. Parameter settings for gauge charts do not take effect. You can set the minimum value, maximum value, scale, and line width of the x-axis or y-axis, whether to display the x-axis and y-axis, and whether the line is smooth. Dynamic modification is not supported.</p>
</td>
</tr>
<tr id="row1541629182218"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p57547371229"><a name="p57547371229"></a><a name="p57547371229"></a>datasets</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p117541437172215"><a name="p117541437172215"></a><a name="p117541437172215"></a>Array&lt;<a href="#table13810518157">ChartDataset</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p7754203711221"><a name="p7754203711221"></a><a name="p7754203711221"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p18754183732216"><a name="p18754183732216"></a><a name="p18754183732216"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p775483772214"><a name="p775483772214"></a><a name="p775483772214"></a>Data set. You must set data sets for bar charts and line charts. Data set for a gauge chart does not take effect. You can set multiple datasets and their background colors.</p>
</td>
</tr>
<tr id="row28045213017"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p18811552104"><a name="p18811552104"></a><a name="p18811552104"></a>segments<sup id="sup567222913217"><a name="sup567222913217"></a><a name="sup567222913217"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p481105219011"><a name="p481105219011"></a><a name="p481105219011"></a><a href="#table2596183616210">DataSegment</a> | Array&lt;<a href="#table2596183616210">DataSegment</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p188135220013"><a name="p188135220013"></a><a name="p188135220013"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p78112529019"><a name="p78112529019"></a><a name="p78112529019"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1455632813277"><a name="p1455632813277"></a><a name="p1455632813277"></a>Data structures used by <strong id="b1997913981710"><a name="b1997913981710"></a><a name="b1997913981710"></a>progress</strong>, <strong id="b991191118176"><a name="b991191118176"></a><a name="b991191118176"></a>loading</strong>, and <strong id="b962820295179"><a name="b962820295179"></a><a name="b962820295179"></a>rainbow</strong> charts.</p>
<p id="p19327195813510"><a name="p19327195813510"></a><a name="p19327195813510"></a><strong id="b196601530164710"><a name="b196601530164710"></a><a name="b196601530164710"></a>DataSegment</strong> is available for <strong id="b1066083012472"><a name="b1066083012472"></a><a name="b1066083012472"></a>progress</strong> and <strong id="b16660143054719"><a name="b16660143054719"></a><a name="b16660143054719"></a>loading</strong> charts.</p>
<p id="p14326258457"><a name="p14326258457"></a><a name="p14326258457"></a><strong id="b1044023344716"><a name="b1044023344716"></a><a name="b1044023344716"></a>Array&lt;<a href="#table2596183616210">DataSegment</a>&gt;</strong> is available for <strong id="b194405335477"><a name="b194405335477"></a><a name="b194405335477"></a>rainbow</strong> charts. A maximum of nine <strong id="b15441133114716"><a name="b15441133114716"></a><a name="b15441133114716"></a>DataSegment</strong> are supported in the array.</p>
<div class="note" id="note74451328478"><a name="note74451328478"></a><a name="note74451328478"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1744552174711"><a name="p1744552174711"></a><a name="p1744552174711"></a></p>
</div></div>
</td>
</tr>
<tr id="row132072752211"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1720712712227"><a name="p1720712712227"></a><a name="p1720712712227"></a>effects<sup id="sup98541850278"><a name="sup98541850278"></a><a name="sup98541850278"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p520815752212"><a name="p520815752212"></a><a name="p520815752212"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p220877132211"><a name="p220877132211"></a><a name="p220877132211"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1820820719229"><a name="p1820820719229"></a><a name="p1820820719229"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p92085712225"><a name="p92085712225"></a><a name="p92085712225"></a>Whether to enable the effects for <strong id="b7262163754711"><a name="b7262163754711"></a><a name="b7262163754711"></a>progress</strong> and <strong id="b12263437134715"><a name="b12263437134715"></a><a name="b12263437134715"></a>rainbow</strong> charts.</p>
<div class="note" id="note15640931164717"><a name="note15640931164717"></a><a name="note15640931164717"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p2064014318476"><a name="p2064014318476"></a><a name="p2064014318476"></a></p>
</div></div>
</td>
</tr>
<tr id="row1133155620405"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p3133956174018"><a name="p3133956174018"></a><a name="p3133956174018"></a>animationduration<sup id="sup1079943994111"><a name="sup1079943994111"></a><a name="sup1079943994111"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p81331564406"><a name="p81331564406"></a><a name="p81331564406"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p21331356194015"><a name="p21331356194015"></a><a name="p21331356194015"></a>3000</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p6133256124018"><a name="p6133256124018"></a><a name="p6133256124018"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p181331564408"><a name="p181331564408"></a><a name="p181331564408"></a>Animation duration for expanding a <strong id="b538918433184"><a name="b538918433184"></a><a name="b538918433184"></a>rainbow</strong> chart, in milliseconds.</p>
<div class="note" id="note12117134774716"><a name="note12117134774716"></a><a name="note12117134774716"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p12117124720471"><a name="p12117124720471"></a><a name="p12117124720471"></a></p>
</div></div>
</td>
</tr>
</tbody>
</table>
**Table 1** ChartOptions
<a name="table12775365017"></a>
<table><thead align="left"><tr id="row6277153195013"><th class="cellrowborder" valign="top" width="16%" id="mcps1.2.6.1.1"><p id="p1192913820507"><a name="p1192913820507"></a><a name="p1192913820507"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="17%" id="mcps1.2.6.1.2"><p id="p2929188125011"><a name="p2929188125011"></a><a name="p2929188125011"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13%" id="mcps1.2.6.1.3"><p id="p6929688508"><a name="p6929688508"></a><a name="p6929688508"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="16%" id="mcps1.2.6.1.4"><p id="p1392938165014"><a name="p1392938165014"></a><a name="p1392938165014"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="38%" id="mcps1.2.6.1.5"><p id="p2092914815016"><a name="p2092914815016"></a><a name="p2092914815016"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row2277638503"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.1 "><p id="p127818375011"><a name="p127818375011"></a><a name="p127818375011"></a>xAxis</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.2 "><p id="p18278183115020"><a name="p18278183115020"></a><a name="p18278183115020"></a><a href="#table11312112919528">ChartAxis</a></p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.2.6.1.3 "><p id="p1327817316507"><a name="p1327817316507"></a><a name="p1327817316507"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.4 "><p id="p427813385011"><a name="p427813385011"></a><a name="p427813385011"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.2.6.1.5 "><p id="p1795144819490"><a name="p1795144819490"></a><a name="p1795144819490"></a>X-axis parameters. You can set the minimum value, maximum value, and scale of the x-axis, and whether to display the x-axis.</p>
</td>
</tr>
<tr id="row14660105412507"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.1 "><p id="p16611654205018"><a name="p16611654205018"></a><a name="p16611654205018"></a>yAxis</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.2 "><p id="p1518631821017"><a name="p1518631821017"></a><a name="p1518631821017"></a><a href="#table11312112919528">ChartAxis</a></p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.2.6.1.3 "><p id="p19661554145015"><a name="p19661554145015"></a><a name="p19661554145015"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.4 "><p id="p466145416502"><a name="p466145416502"></a><a name="p466145416502"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.2.6.1.5 "><p id="p14661554125010"><a name="p14661554125010"></a><a name="p14661554125010"></a>Y-axis parameters. You can set the minimum value, maximum value, and scale of the y-axis, and whether to display the y-axis.</p>
</td>
</tr>
<tr id="row1816015565013"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.1 "><p id="p1816005585019"><a name="p1816005585019"></a><a name="p1816005585019"></a>series</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.2 "><p id="p91601455135019"><a name="p91601455135019"></a><a name="p91601455135019"></a><a href="#table029562010560">ChartSeries</a></p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.2.6.1.3 "><p id="p416015565016"><a name="p416015565016"></a><a name="p416015565016"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.6.1.4 "><p id="p12160135565014"><a name="p12160135565014"></a><a name="p12160135565014"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.2.6.1.5 "><p id="p236434673016"><a name="p236434673016"></a><a name="p236434673016"></a>Data sequence parameters.</p>
<a name="ul4402155710308"></a><a name="ul4402155710308"></a><ul id="ul4402155710308"><li>Line style, such as the line width and whether the line is smooth.</li><li>Style and size of the white point at the start of the line.</li></ul>
<div class="note" id="note163611718126"><a name="note163611718126"></a><a name="note163611718126"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p15361117191211"><a name="p15361117191211"></a><a name="p15361117191211"></a>Only line charts support this attribute.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
**Table 2** ChartDataset
<a name="table13810518157"></a>
<table><thead align="left"><tr id="row1839105121514"><th class="cellrowborder" valign="top" width="16.56%" id="mcps1.2.6.1.1"><p id="p106956431614"><a name="p106956431614"></a><a name="p106956431614"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="16.830000000000002%" id="mcps1.2.6.1.2"><p id="p0695204111617"><a name="p0695204111617"></a><a name="p0695204111617"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.989999999999998%" id="mcps1.2.6.1.3"><p id="p1069514141614"><a name="p1069514141614"></a><a name="p1069514141614"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.33%" id="mcps1.2.6.1.4"><p id="p969564191616"><a name="p969564191616"></a><a name="p969564191616"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="44.29%" id="mcps1.2.6.1.5"><p id="p1169616441615"><a name="p1169616441615"></a><a name="p1169616441615"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1383242819553"><td class="cellrowborder" valign="top" width="16.56%" headers="mcps1.2.6.1.1 "><p id="p13832192819557"><a name="p13832192819557"></a><a name="p13832192819557"></a>strokeColor</p>
</td>
<td class="cellrowborder" valign="top" width="16.830000000000002%" headers="mcps1.2.6.1.2 "><p id="p18321928145512"><a name="p18321928145512"></a><a name="p18321928145512"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.989999999999998%" headers="mcps1.2.6.1.3 "><p id="p1283202816559"><a name="p1283202816559"></a><a name="p1283202816559"></a>#ff6384</p>
</td>
<td class="cellrowborder" valign="top" width="9.33%" headers="mcps1.2.6.1.4 "><p id="p128322028155519"><a name="p128322028155519"></a><a name="p128322028155519"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.29%" headers="mcps1.2.6.1.5 "><p id="p383218285552"><a name="p383218285552"></a><a name="p383218285552"></a>Line color.</p>
<div class="note" id="note149682371351"><a name="note149682371351"></a><a name="note149682371351"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p189688371757"><a name="p189688371757"></a><a name="p189688371757"></a>Only line charts support this attribute.</p>
</div></div>
</td>
</tr>
<tr id="row207559395562"><td class="cellrowborder" valign="top" width="16.56%" headers="mcps1.2.6.1.1 "><p id="p177551539205614"><a name="p177551539205614"></a><a name="p177551539205614"></a>fillColor</p>
</td>
<td class="cellrowborder" valign="top" width="16.830000000000002%" headers="mcps1.2.6.1.2 "><p id="p15755143911563"><a name="p15755143911563"></a><a name="p15755143911563"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.989999999999998%" headers="mcps1.2.6.1.3 "><p id="p9755939185618"><a name="p9755939185618"></a><a name="p9755939185618"></a>#ff6384</p>
</td>
<td class="cellrowborder" valign="top" width="9.33%" headers="mcps1.2.6.1.4 "><p id="p1875553995610"><a name="p1875553995610"></a><a name="p1875553995610"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.29%" headers="mcps1.2.6.1.5 "><p id="p975563915619"><a name="p975563915619"></a><a name="p975563915619"></a>Fill color. For line charts, the value indicates the gradient color to fill.</p>
</td>
</tr>
<tr id="row16221319185010"><td class="cellrowborder" valign="top" width="16.56%" headers="mcps1.2.6.1.1 "><p id="p1939135171519"><a name="p1939135171519"></a><a name="p1939135171519"></a>data</p>
</td>
<td class="cellrowborder" valign="top" width="16.830000000000002%" headers="mcps1.2.6.1.2 "><p id="p93945114156"><a name="p93945114156"></a><a name="p93945114156"></a>Array&lt;number&gt; | Array&lt;<a href="#table1470733752019">Point</a>&gt;<sup id="sup748712541259"><a name="sup748712541259"></a><a name="sup748712541259"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.989999999999998%" headers="mcps1.2.6.1.3 "><p id="p1839951201514"><a name="p1839951201514"></a><a name="p1839951201514"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.33%" headers="mcps1.2.6.1.4 "><p id="p4391651201517"><a name="p4391651201517"></a><a name="p4391651201517"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="44.29%" headers="mcps1.2.6.1.5 "><p id="p113975114159"><a name="p113975114159"></a><a name="p113975114159"></a>Data of the drawn line or bar.</p>
</td>
</tr>
<tr id="row284113911529"><td class="cellrowborder" valign="top" width="16.56%" headers="mcps1.2.6.1.1 "><p id="p884110975213"><a name="p884110975213"></a><a name="p884110975213"></a>gradient</p>
</td>
<td class="cellrowborder" valign="top" width="16.830000000000002%" headers="mcps1.2.6.1.2 "><p id="p168411494528"><a name="p168411494528"></a><a name="p168411494528"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="12.989999999999998%" headers="mcps1.2.6.1.3 "><p id="p7841992522"><a name="p7841992522"></a><a name="p7841992522"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="9.33%" headers="mcps1.2.6.1.4 "><p id="p1684159195214"><a name="p1684159195214"></a><a name="p1684159195214"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.29%" headers="mcps1.2.6.1.5 "><p id="p198414916522"><a name="p198414916522"></a><a name="p198414916522"></a>Whether to display the gradient color.</p>
<div class="note" id="note55873241061"><a name="note55873241061"></a><a name="note55873241061"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1558712410616"><a name="p1558712410616"></a><a name="p1558712410616"></a>Only line charts support this attribute.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
**Table 3** ChartAxis
<a name="table11312112919528"></a>
<table><thead align="left"><tr id="row1031252917522"><th class="cellrowborder" valign="top" width="16.650000000000002%" id="mcps1.2.6.1.1"><p id="p7835550165517"><a name="p7835550165517"></a><a name="p7835550165517"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="16.3%" id="mcps1.2.6.1.2"><p id="p2083515012555"><a name="p2083515012555"></a><a name="p2083515012555"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.91%" id="mcps1.2.6.1.3"><p id="p1283545016551"><a name="p1283545016551"></a><a name="p1283545016551"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.5%" id="mcps1.2.6.1.4"><p id="p18351650135519"><a name="p18351650135519"></a><a name="p18351650135519"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="44.64%" id="mcps1.2.6.1.5"><p id="p10835105017555"><a name="p10835105017555"></a><a name="p10835105017555"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row231352916527"><td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.2.6.1.1 "><p id="p13313529145212"><a name="p13313529145212"></a><a name="p13313529145212"></a>min</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.2.6.1.2 "><p id="p14313429185211"><a name="p14313429185211"></a><a name="p14313429185211"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="12.91%" headers="mcps1.2.6.1.3 "><p id="p19313152995219"><a name="p19313152995219"></a><a name="p19313152995219"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="9.5%" headers="mcps1.2.6.1.4 "><p id="p03131429165220"><a name="p03131429165220"></a><a name="p03131429165220"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.64%" headers="mcps1.2.6.1.5 "><p id="p15313529165215"><a name="p15313529165215"></a><a name="p15313529165215"></a>Minimum value of the axis.</p>
<div class="note" id="note947711273197"><a name="note947711273197"></a><a name="note947711273197"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p5477102781911"><a name="p5477102781911"></a><a name="p5477102781911"></a>Only line charts support negative numbers.</p>
</div></div>
</td>
</tr>
<tr id="row10177207165517"><td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.2.6.1.1 "><p id="p191773713559"><a name="p191773713559"></a><a name="p191773713559"></a>max</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.2.6.1.2 "><p id="p11771076557"><a name="p11771076557"></a><a name="p11771076557"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="12.91%" headers="mcps1.2.6.1.3 "><p id="p13177127165511"><a name="p13177127165511"></a><a name="p13177127165511"></a>100</p>
</td>
<td class="cellrowborder" valign="top" width="9.5%" headers="mcps1.2.6.1.4 "><p id="p171774715517"><a name="p171774715517"></a><a name="p171774715517"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.64%" headers="mcps1.2.6.1.5 "><p id="p111771705519"><a name="p111771705519"></a><a name="p111771705519"></a>Maximum value of the axis.</p>
<div class="note" id="note1287217389195"><a name="note1287217389195"></a><a name="note1287217389195"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p17872153817197"><a name="p17872153817197"></a><a name="p17872153817197"></a>Only line charts support negative numbers.</p>
</div></div>
</td>
</tr>
<tr id="row54401875553"><td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.2.6.1.1 "><p id="p544037145514"><a name="p544037145514"></a><a name="p544037145514"></a>axisTick</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.2.6.1.2 "><p id="p844011745512"><a name="p844011745512"></a><a name="p844011745512"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="12.91%" headers="mcps1.2.6.1.3 "><p id="p9440277558"><a name="p9440277558"></a><a name="p9440277558"></a>10</p>
</td>
<td class="cellrowborder" valign="top" width="9.5%" headers="mcps1.2.6.1.4 "><p id="p194406755518"><a name="p194406755518"></a><a name="p194406755518"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.64%" headers="mcps1.2.6.1.5 "><p id="p1144027105511"><a name="p1144027105511"></a><a name="p1144027105511"></a>Number of scales displayed on the axis.</p>
<div class="note" id="note18942121511202"><a name="note18942121511202"></a><a name="note18942121511202"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p4709421681"><a name="p4709421681"></a><a name="p4709421681"></a>The value ranges from 1 to 20. The display effect depends on the calculation result of Number of pixels occupied by the image width/(<strong id="b17205813354"><a name="b17205813354"></a><a name="b17205813354"></a>max</strong>-<strong id="b182718418359"><a name="b182718418359"></a><a name="b182718418359"></a>min</strong>).</p>
<p id="p234142016205"><a name="p234142016205"></a><a name="p234142016205"></a>In the bar chart, the number of bars in each group of data is the same as the number of scales, and the bars are displayed at the scales.</p>
</div></div>
</td>
</tr>
<tr id="row6558148125516"><td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.2.6.1.1 "><p id="p1555818865515"><a name="p1555818865515"></a><a name="p1555818865515"></a>display</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.2.6.1.2 "><p id="p1755910815552"><a name="p1755910815552"></a><a name="p1755910815552"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="12.91%" headers="mcps1.2.6.1.3 "><p id="p2559108195515"><a name="p2559108195515"></a><a name="p2559108195515"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="9.5%" headers="mcps1.2.6.1.4 "><p id="p185597805514"><a name="p185597805514"></a><a name="p185597805514"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.64%" headers="mcps1.2.6.1.5 "><p id="p1655910815551"><a name="p1655910815551"></a><a name="p1655910815551"></a>Whether to display the axis.</p>
</td>
</tr>
<tr id="row1382114065515"><td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.2.6.1.1 "><p id="p188221209555"><a name="p188221209555"></a><a name="p188221209555"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.2.6.1.2 "><p id="p1782214025517"><a name="p1782214025517"></a><a name="p1782214025517"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.91%" headers="mcps1.2.6.1.3 "><p id="p482220185512"><a name="p482220185512"></a><a name="p482220185512"></a>#c0c0c0</p>
</td>
<td class="cellrowborder" valign="top" width="9.5%" headers="mcps1.2.6.1.4 "><p id="p782214015553"><a name="p782214015553"></a><a name="p782214015553"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.64%" headers="mcps1.2.6.1.5 "><p id="p4822202556"><a name="p4822202556"></a><a name="p4822202556"></a>Axis color.</p>
</td>
</tr>
</tbody>
</table>
**Table 4** ChartSeries
<a name="table029562010560"></a>
<table><thead align="left"><tr id="row9295192095610"><th class="cellrowborder" valign="top" width="17%" id="mcps1.2.6.1.1"><p id="p10617123345612"><a name="p10617123345612"></a><a name="p10617123345612"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="16.39%" id="mcps1.2.6.1.2"><p id="p9617133175613"><a name="p9617133175613"></a><a name="p9617133175613"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.82%" id="mcps1.2.6.1.3"><p id="p3617153315562"><a name="p3617153315562"></a><a name="p3617153315562"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="10.11%" id="mcps1.2.6.1.4"><p id="p4617163305612"><a name="p4617163305612"></a><a name="p4617163305612"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="43.68%" id="mcps1.2.6.1.5"><p id="p1561718337569"><a name="p1561718337569"></a><a name="p1561718337569"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row13295162011563"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.1 "><p id="p2296820185612"><a name="p2296820185612"></a><a name="p2296820185612"></a>lineStyle</p>
</td>
<td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.2.6.1.2 "><p id="p529652005615"><a name="p529652005615"></a><a name="p529652005615"></a><a href="#table7790183513918">ChartLineStyle</a></p>
</td>
<td class="cellrowborder" valign="top" width="12.82%" headers="mcps1.2.6.1.3 "><p id="p629612208561"><a name="p629612208561"></a><a name="p629612208561"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.11%" headers="mcps1.2.6.1.4 "><p id="p129632065619"><a name="p129632065619"></a><a name="p129632065619"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.68%" headers="mcps1.2.6.1.5 "><p id="p929652045614"><a name="p929652045614"></a><a name="p929652045614"></a>Line style, such as the line width and whether the line is smooth.</p>
</td>
</tr>
<tr id="row1829652010566"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.1 "><p id="p17296112017565"><a name="p17296112017565"></a><a name="p17296112017565"></a>headPoint</p>
</td>
<td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.2.6.1.2 "><p id="p1829632018566"><a name="p1829632018566"></a><a name="p1829632018566"></a><a href="#table1435760101317">PointStyle</a></p>
</td>
<td class="cellrowborder" valign="top" width="12.82%" headers="mcps1.2.6.1.3 "><p id="p52966203569"><a name="p52966203569"></a><a name="p52966203569"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.11%" headers="mcps1.2.6.1.4 "><p id="p17296020155611"><a name="p17296020155611"></a><a name="p17296020155611"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.68%" headers="mcps1.2.6.1.5 "><p id="p14296132015616"><a name="p14296132015616"></a><a name="p14296132015616"></a>Style and size of the white point at the start of the line.</p>
</td>
</tr>
<tr id="row416985481620"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.1 "><p id="p816915441619"><a name="p816915441619"></a><a name="p816915441619"></a>topPoint</p>
</td>
<td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.2.6.1.2 "><p id="p13169145471618"><a name="p13169145471618"></a><a name="p13169145471618"></a><a href="#table1435760101317">PointStyle</a></p>
</td>
<td class="cellrowborder" valign="top" width="12.82%" headers="mcps1.2.6.1.3 "><p id="p816995416164"><a name="p816995416164"></a><a name="p816995416164"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.11%" headers="mcps1.2.6.1.4 "><p id="p2017015417166"><a name="p2017015417166"></a><a name="p2017015417166"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.68%" headers="mcps1.2.6.1.5 "><p id="p98810719197"><a name="p98810719197"></a><a name="p98810719197"></a>Style and size of the top point.</p>
</td>
</tr>
<tr id="row9719195771616"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.1 "><p id="p12719857161614"><a name="p12719857161614"></a><a name="p12719857161614"></a>bottomPoint</p>
</td>
<td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.2.6.1.2 "><p id="p631412816137"><a name="p631412816137"></a><a name="p631412816137"></a><a href="#table1435760101317">PointStyle</a></p>
</td>
<td class="cellrowborder" valign="top" width="12.82%" headers="mcps1.2.6.1.3 "><p id="p1771995719166"><a name="p1771995719166"></a><a name="p1771995719166"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.11%" headers="mcps1.2.6.1.4 "><p id="p77192571166"><a name="p77192571166"></a><a name="p77192571166"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.68%" headers="mcps1.2.6.1.5 "><p id="p10719357111610"><a name="p10719357111610"></a><a name="p10719357111610"></a>Style and size of the bottom point.</p>
</td>
</tr>
<tr id="row1165515117356"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.2.6.1.1 "><p id="p1065610143518"><a name="p1065610143518"></a><a name="p1065610143518"></a>loop</p>
</td>
<td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.2.6.1.2 "><p id="p8656121143511"><a name="p8656121143511"></a><a name="p8656121143511"></a><a href="#table13982347173714">ChartLoop</a></p>
</td>
<td class="cellrowborder" valign="top" width="12.82%" headers="mcps1.2.6.1.3 "><p id="p765611163510"><a name="p765611163510"></a><a name="p765611163510"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.11%" headers="mcps1.2.6.1.4 "><p id="p1965671123510"><a name="p1965671123510"></a><a name="p1965671123510"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.68%" headers="mcps1.2.6.1.5 "><p id="p19656131113517"><a name="p19656131113517"></a><a name="p19656131113517"></a>Whether to start drawing again when the screen is looped.</p>
</td>
</tr>
</tbody>
</table>
**Table 5** ChartLineStyle
<a name="table7790183513918"></a>
<table><thead align="left"><tr id="row167906351914"><th class="cellrowborder" valign="top" width="17.09%" id="mcps1.2.6.1.1"><p id="p15238040191012"><a name="p15238040191012"></a><a name="p15238040191012"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="16.91%" id="mcps1.2.6.1.2"><p id="p142381440151020"><a name="p142381440151020"></a><a name="p142381440151020"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.690000000000001%" id="mcps1.2.6.1.3"><p id="p723814051011"><a name="p723814051011"></a><a name="p723814051011"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="10.24%" id="mcps1.2.6.1.4"><p id="p623818402108"><a name="p623818402108"></a><a name="p623818402108"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="43.07%" id="mcps1.2.6.1.5"><p id="p1223834091020"><a name="p1223834091020"></a><a name="p1223834091020"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row47909350912"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p13791135393"><a name="p13791135393"></a><a name="p13791135393"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="16.91%" headers="mcps1.2.6.1.2 "><p id="p5791123511915"><a name="p5791123511915"></a><a name="p5791123511915"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.690000000000001%" headers="mcps1.2.6.1.3 "><p id="p1479120352916"><a name="p1479120352916"></a><a name="p1479120352916"></a>1px</p>
</td>
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.2.6.1.4 "><p id="p87911135691"><a name="p87911135691"></a><a name="p87911135691"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.07%" headers="mcps1.2.6.1.5 "><p id="p47917356918"><a name="p47917356918"></a><a name="p47917356918"></a>Line width.</p>
</td>
</tr>
<tr id="row1279183510911"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p107913351297"><a name="p107913351297"></a><a name="p107913351297"></a>smooth</p>
</td>
<td class="cellrowborder" valign="top" width="16.91%" headers="mcps1.2.6.1.2 "><p id="p1479113515915"><a name="p1479113515915"></a><a name="p1479113515915"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="12.690000000000001%" headers="mcps1.2.6.1.3 "><p id="p179111356910"><a name="p179111356910"></a><a name="p179111356910"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="10.24%" headers="mcps1.2.6.1.4 "><p id="p979117355914"><a name="p979117355914"></a><a name="p979117355914"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.07%" headers="mcps1.2.6.1.5 "><p id="p1879113353920"><a name="p1879113353920"></a><a name="p1879113353920"></a>Whether the line is smooth.</p>
</td>
</tr>
</tbody>
</table>
**Table 6** PointStyle
<a name="table1435760101317"></a>
<table><thead align="left"><tr id="row0357180181315"><th class="cellrowborder" valign="top" width="17.09%" id="mcps1.2.6.1.1"><p id="p763402181310"><a name="p763402181310"></a><a name="p763402181310"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="17.09%" id="mcps1.2.6.1.2"><p id="p963402171313"><a name="p963402171313"></a><a name="p963402171313"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.64%" id="mcps1.2.6.1.3"><p id="p166343212133"><a name="p166343212133"></a><a name="p166343212133"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="10.549999999999999%" id="mcps1.2.6.1.4"><p id="p4634621111311"><a name="p4634621111311"></a><a name="p4634621111311"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="42.63%" id="mcps1.2.6.1.5"><p id="p2063413215132"><a name="p2063413215132"></a><a name="p2063413215132"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row53581105131"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p12358803137"><a name="p12358803137"></a><a name="p12358803137"></a>shape</p>
</td>
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.2 "><p id="p19358190201313"><a name="p19358190201313"></a><a name="p19358190201313"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.2.6.1.3 "><p id="p1358170141315"><a name="p1358170141315"></a><a name="p1358170141315"></a>circle</p>
</td>
<td class="cellrowborder" valign="top" width="10.549999999999999%" headers="mcps1.2.6.1.4 "><p id="p0358203135"><a name="p0358203135"></a><a name="p0358203135"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.63%" headers="mcps1.2.6.1.5 "><p id="p113581206134"><a name="p113581206134"></a><a name="p113581206134"></a>Shape of the highlight point. Available values are as follows:</p>
<a name="ul107389175319"></a><a name="ul107389175319"></a><ul id="ul107389175319"><li>Circle</li><li>Square</li><li>Triangle</li></ul>
</td>
</tr>
<tr id="row143581011317"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p19358200201311"><a name="p19358200201311"></a><a name="p19358200201311"></a>size</p>
</td>
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.2 "><p id="p93585011135"><a name="p93585011135"></a><a name="p93585011135"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.2.6.1.3 "><p id="p203581081313"><a name="p203581081313"></a><a name="p203581081313"></a>5px</p>
</td>
<td class="cellrowborder" valign="top" width="10.549999999999999%" headers="mcps1.2.6.1.4 "><p id="p183582008137"><a name="p183582008137"></a><a name="p183582008137"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.63%" headers="mcps1.2.6.1.5 "><p id="p2358502135"><a name="p2358502135"></a><a name="p2358502135"></a>Size of the highlight point.</p>
</td>
</tr>
<tr id="row957985594815"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p11579165564814"><a name="p11579165564814"></a><a name="p11579165564814"></a>strokeWidth</p>
</td>
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.2 "><p id="p657916559486"><a name="p657916559486"></a><a name="p657916559486"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.2.6.1.3 "><p id="p12579105514489"><a name="p12579105514489"></a><a name="p12579105514489"></a>1px</p>
</td>
<td class="cellrowborder" valign="top" width="10.549999999999999%" headers="mcps1.2.6.1.4 "><p id="p958015514480"><a name="p958015514480"></a><a name="p958015514480"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.63%" headers="mcps1.2.6.1.5 "><p id="p3580115534814"><a name="p3580115534814"></a><a name="p3580115534814"></a>Stroke width.</p>
</td>
</tr>
<tr id="row51421313317"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p151432333315"><a name="p151432333315"></a><a name="p151432333315"></a>strokeColor</p>
</td>
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.2 "><p id="p1914312363315"><a name="p1914312363315"></a><a name="p1914312363315"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.2.6.1.3 "><p id="p114319316335"><a name="p114319316335"></a><a name="p114319316335"></a>#ff0000</p>
</td>
<td class="cellrowborder" valign="top" width="10.549999999999999%" headers="mcps1.2.6.1.4 "><p id="p11431036331"><a name="p11431036331"></a><a name="p11431036331"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.63%" headers="mcps1.2.6.1.5 "><p id="p181441434339"><a name="p181441434339"></a><a name="p181441434339"></a>Frame color.</p>
</td>
</tr>
<tr id="row1312214335332"><td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.1 "><p id="p10123233193310"><a name="p10123233193310"></a><a name="p10123233193310"></a>fillColor</p>
</td>
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.2.6.1.2 "><p id="p12123233123310"><a name="p12123233123310"></a><a name="p12123233123310"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.2.6.1.3 "><p id="p10123143343313"><a name="p10123143343313"></a><a name="p10123143343313"></a>#ff0000</p>
</td>
<td class="cellrowborder" valign="top" width="10.549999999999999%" headers="mcps1.2.6.1.4 "><p id="p16123163317338"><a name="p16123163317338"></a><a name="p16123163317338"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.63%" headers="mcps1.2.6.1.5 "><p id="p6123433193311"><a name="p6123433193311"></a><a name="p6123433193311"></a>Fill color.</p>
</td>
</tr>
</tbody>
</table>
**Table 7** ChartLoop
<a name="table13982347173714"></a> None
<table><thead align="left"><tr id="row1498384714371"><th class="cellrowborder" valign="top" width="17.31%" id="mcps1.2.6.1.1"><p id="p1640543183916"><a name="p1640543183916"></a><a name="p1640543183916"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="17.65%" id="mcps1.2.6.1.2"><p id="p18640043143916"><a name="p18640043143916"></a><a name="p18640043143916"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="11.62%" id="mcps1.2.6.1.3"><p id="p12640144317398"><a name="p12640144317398"></a><a name="p12640144317398"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="11.39%" id="mcps1.2.6.1.4"><p id="p1764014343915"><a name="p1764014343915"></a><a name="p1764014343915"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="42.03%" id="mcps1.2.6.1.5"><p id="p1064084314395"><a name="p1064084314395"></a><a name="p1064084314395"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row8983164710376"><td class="cellrowborder" valign="top" width="17.31%" headers="mcps1.2.6.1.1 "><p id="p11983147113716"><a name="p11983147113716"></a><a name="p11983147113716"></a>margin</p>
</td>
<td class="cellrowborder" valign="top" width="17.65%" headers="mcps1.2.6.1.2 "><p id="p1898316477374"><a name="p1898316477374"></a><a name="p1898316477374"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="11.62%" headers="mcps1.2.6.1.3 "><p id="p139841479376"><a name="p139841479376"></a><a name="p139841479376"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="11.39%" headers="mcps1.2.6.1.4 "><p id="p169842479376"><a name="p169842479376"></a><a name="p169842479376"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.03%" headers="mcps1.2.6.1.5 "><p id="p798434723720"><a name="p798434723720"></a><a name="p798434723720"></a>Number of erased points (horizontal distance between the latest drawn point and the earliest point). You are not advised to use <strong id="b16357142745814"><a name="b16357142745814"></a><a name="b16357142745814"></a>margin</strong> together with <strong id="b188717325586"><a name="b188717325586"></a><a name="b188717325586"></a>topPoint</strong>, <strong id="b32281537165815"><a name="b32281537165815"></a><a name="b32281537165815"></a>bottomPoint</strong>, or <strong id="b2578114315585"><a name="b2578114315585"></a><a name="b2578114315585"></a>headPoint</strong> for lite devices. If you do so, there is a possibility that the point is in the erase area and invisible.</p>
</td>
</tr>
<tr id="row109849472372"><td class="cellrowborder" valign="top" width="17.31%" headers="mcps1.2.6.1.1 "><p id="p09841047183715"><a name="p09841047183715"></a><a name="p09841047183715"></a>gradient</p>
</td>
<td class="cellrowborder" valign="top" width="17.65%" headers="mcps1.2.6.1.2 "><p id="p92761838193812"><a name="p92761838193812"></a><a name="p92761838193812"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="11.62%" headers="mcps1.2.6.1.3 "><p id="p127603819380"><a name="p127603819380"></a><a name="p127603819380"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="11.39%" headers="mcps1.2.6.1.4 "><p id="p227733816384"><a name="p227733816384"></a><a name="p227733816384"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.03%" headers="mcps1.2.6.1.5 "><p id="p13277173823811"><a name="p13277173823811"></a><a name="p13277173823811"></a>Whether to perform gradient erase.</p>
</td>
</tr>
</tbody>
</table>
**Table 8** Point<sup>5+</sup>
<a name="table1470733752019"></a>
<table><thead align="left"><tr id="row177072373203"><th class="cellrowborder" valign="top" width="11.85%" id="mcps1.2.6.1.1"><p id="p1770793715201"><a name="p1770793715201"></a><a name="p1770793715201"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.030000000000001%" id="mcps1.2.6.1.2"><p id="p137073372202"><a name="p137073372202"></a><a name="p137073372202"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="9.83%" id="mcps1.2.6.1.3"><p id="p47078377208"><a name="p47078377208"></a><a name="p47078377208"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.04%" id="mcps1.2.6.1.4"><p id="p1470719376206"><a name="p1470719376206"></a><a name="p1470719376206"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="57.25%" id="mcps1.2.6.1.5"><p id="p1370783712017"><a name="p1370783712017"></a><a name="p1370783712017"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row137071737112010"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p9707153711207"><a name="p9707153711207"></a><a name="p9707153711207"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p157081437132013"><a name="p157081437132013"></a><a name="p157081437132013"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p970833722016"><a name="p970833722016"></a><a name="p970833722016"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p2070812378209"><a name="p2070812378209"></a><a name="p2070812378209"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p188430361213"><a name="p188430361213"></a><a name="p188430361213"></a>Y coordinate of the point to draw.</p>
</td>
</tr>
<tr id="row13708173719202"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p18708143772014"><a name="p18708143772014"></a><a name="p18708143772014"></a>pointStyle</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p77081637172018"><a name="p77081637172018"></a><a name="p77081637172018"></a><a href="#table1435760101317">PointStyle</a></p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p270803719206"><a name="p270803719206"></a><a name="p270803719206"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p19708133782018"><a name="p19708133782018"></a><a name="p19708133782018"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p12708203712010"><a name="p12708203712010"></a><a name="p12708203712010"></a>Style of the point.</p>
</td>
</tr>
<tr id="row431291710242"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p13131917162412"><a name="p13131917162412"></a><a name="p13131917162412"></a>description</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p1231341710240"><a name="p1231341710240"></a><a name="p1231341710240"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p14313121716241"><a name="p14313121716241"></a><a name="p14313121716241"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p13139178245"><a name="p13139178245"></a><a name="p13139178245"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p11313171716246"><a name="p11313171716246"></a><a name="p11313171716246"></a>Description text of the point.</p>
</td>
</tr>
<tr id="row431301902517"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p1931461914251"><a name="p1931461914251"></a><a name="p1931461914251"></a>textLocation</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p1331471915257"><a name="p1331471915257"></a><a name="p1331471915257"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p331431992516"><a name="p331431992516"></a><a name="p331431992516"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p33145199254"><a name="p33145199254"></a><a name="p33145199254"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p6108637185"><a name="p6108637185"></a><a name="p6108637185"></a>Description text position relative to the point. Available values are as follows: </p>
<p id="p15749138180"><a name="p15749138180"></a><a name="p15749138180"></a><strong id="b117496386820"><a name="b117496386820"></a><a name="b117496386820"></a>top</strong>: above the point </p>
<p id="p65480401482"><a name="p65480401482"></a><a name="p65480401482"></a><strong id="b105484402815"><a name="b105484402815"></a><a name="b105484402815"></a>bottom</strong>: below the point </p>
<p id="p20314141922517"><a name="p20314141922517"></a><a name="p20314141922517"></a><strong id="b171799461313"><a name="b171799461313"></a><a name="b171799461313"></a>none</strong>: not displayed</p>
</td>
</tr>
<tr id="row48671150122613"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p486819509261"><a name="p486819509261"></a><a name="p486819509261"></a>textColor</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p12868165002617"><a name="p12868165002617"></a><a name="p12868165002617"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p4868205002616"><a name="p4868205002616"></a><a name="p4868205002616"></a>#000000</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p1286825017267"><a name="p1286825017267"></a><a name="p1286825017267"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p13868150162611"><a name="p13868150162611"></a><a name="p13868150162611"></a>Color of the description text.</p>
</td>
</tr>
<tr id="row9703542172713"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p1870364214275"><a name="p1870364214275"></a><a name="p1870364214275"></a>lineDash</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p1470334222718"><a name="p1470334222718"></a><a name="p1470334222718"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p1670324217274"><a name="p1670324217274"></a><a name="p1670324217274"></a>solid</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p197033423272"><a name="p197033423272"></a><a name="p197033423272"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p570304202712"><a name="p570304202712"></a><a name="p570304202712"></a>Dashed line pattern. You can set the dash length and space length between the dashes. For example, <strong id="b7111914270"><a name="b7111914270"></a><a name="b7111914270"></a>"dashed, 5, 5"</strong> indicates a dashed line with each dash in 5 px and a 5 px space between each two dashes. Default value <strong id="b08251016203215"><a name="b08251016203215"></a><a name="b08251016203215"></a>"solid"</strong> indicates a solid line.</p>
</td>
</tr>
<tr id="row15389105792810"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p15389357102818"><a name="p15389357102818"></a><a name="p15389357102818"></a>lineColor</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p3389135711281"><a name="p3389135711281"></a><a name="p3389135711281"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p135711197293"><a name="p135711197293"></a><a name="p135711197293"></a>#000000</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p17389105762819"><a name="p17389105762819"></a><a name="p17389105762819"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="a83b9b1430350465dbd6a99d5a0338e2c"><a name="a83b9b1430350465dbd6a99d5a0338e2c"></a><a name="a83b9b1430350465dbd6a99d5a0338e2c"></a>Line color. If this attribute is not set, the <strong id="b17128123414344"><a name="b17128123414344"></a><a name="b17128123414344"></a>strokeColor</strong> is used by default.</p>
</td>
</tr>
</tbody>
</table>
**Table 9** DataSegment<sup>5+</sup>
<a name="table2596183616210"></a>
<table><thead align="left"><tr id="row15969362212"><th class="cellrowborder" valign="top" width="11.85%" id="mcps1.2.6.1.1"><p id="p159616362220"><a name="p159616362220"></a><a name="p159616362220"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.030000000000001%" id="mcps1.2.6.1.2"><p id="p175961136723"><a name="p175961136723"></a><a name="p175961136723"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="9.83%" id="mcps1.2.6.1.3"><p id="p259612361126"><a name="p259612361126"></a><a name="p259612361126"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.04%" id="mcps1.2.6.1.4"><p id="p135975361628"><a name="p135975361628"></a><a name="p135975361628"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="57.25%" id="mcps1.2.6.1.5"><p id="p13597136925"><a name="p13597136925"></a><a name="p13597136925"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row165974360212"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p21970268105"><a name="p21970268105"></a><a name="p21970268105"></a>startColor</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p21981526141010"><a name="p21981526141010"></a><a name="p21981526141010"></a>Color</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p71988268108"><a name="p71988268108"></a><a name="p71988268108"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p6597133616215"><a name="p6597133616215"></a><a name="p6597133616215"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p5652139121119"><a name="p5652139121119"></a><a name="p5652139121119"></a>Color of the start position. If this attribute is set, <strong id="b14583141810491"><a name="b14583141810491"></a><a name="b14583141810491"></a>endColor</strong> must be set. If this attribute is not set, the default color array preset in the system is used. For details about the color values, see the next table.</p>
</td>
</tr>
<tr id="row559719369213"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p1419812651017"><a name="p1419812651017"></a><a name="p1419812651017"></a>endColor</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p8198182631012"><a name="p8198182631012"></a><a name="p8198182631012"></a>Color</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p17198122612107"><a name="p17198122612107"></a><a name="p17198122612107"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p059710361211"><a name="p059710361211"></a><a name="p059710361211"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p11652139131117"><a name="p11652139131117"></a><a name="p11652139131117"></a>Color of the end position. If this attribute is set, <strong id="b12654176135111"><a name="b12654176135111"></a><a name="b12654176135111"></a>startColor</strong> must be set.</p>
<p id="p10128174015175"><a name="p10128174015175"></a><a name="p10128174015175"></a>If this attribute is not set, the default color array preset in the system is used.</p>
</td>
</tr>
<tr id="row85973361925"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p91981926191015"><a name="p91981926191015"></a><a name="p91981926191015"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p1219813268100"><a name="p1219813268100"></a><a name="p1219813268100"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p01988268105"><a name="p01988268105"></a><a name="p01988268105"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p1959819361216"><a name="p1959819361216"></a><a name="p1959819361216"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p106521339131120"><a name="p106521339131120"></a><a name="p106521339131120"></a>Percentage for the current data segment. The maximum value is <strong id="b9780144416522"><a name="b9780144416522"></a><a name="b9780144416522"></a>100</strong>.</p>
</td>
</tr>
<tr id="row85983361124"><td class="cellrowborder" valign="top" width="11.85%" headers="mcps1.2.6.1.1 "><p id="p1119816260101"><a name="p1119816260101"></a><a name="p1119816260101"></a>name</p>
</td>
<td class="cellrowborder" valign="top" width="12.030000000000001%" headers="mcps1.2.6.1.2 "><p id="p6198226161014"><a name="p6198226161014"></a><a name="p6198226161014"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="9.83%" headers="mcps1.2.6.1.3 "><p id="p1519852614107"><a name="p1519852614107"></a><a name="p1519852614107"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.04%" headers="mcps1.2.6.1.4 "><p id="p25984367213"><a name="p25984367213"></a><a name="p25984367213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="57.25%" headers="mcps1.2.6.1.5 "><p id="p11653339151117"><a name="p11653339151117"></a><a name="p11653339151117"></a>Name of this data segment.</p>
</td>
</tr>
</tbody>
</table>
<a name="table19699121263711"></a>
<table><thead align="left"><tr id="row106991512133715"><th class="cellrowborder" valign="top" width="5.8205820582058205%" id="mcps1.1.4.1.1"><p id="p9699181218379"><a name="p9699181218379"></a><a name="p9699181218379"></a>Data Segment</p>
</th>
<th class="cellrowborder" valign="top" width="41.7941794179418%" id="mcps1.1.4.1.2"><p id="p1699171219372"><a name="p1699171219372"></a><a name="p1699171219372"></a>Light Mode</p>
</th>
<th class="cellrowborder" valign="top" width="52.38523852385239%" id="mcps1.1.4.1.3"><p id="p16699112103710"><a name="p16699112103710"></a><a name="p16699112103710"></a>Dark Mode</p>
</th>
</tr>
</thead>
<tbody><tr id="row9699112163711"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p36992012193712"><a name="p36992012193712"></a><a name="p36992012193712"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p15700712163717"><a name="p15700712163717"></a><a name="p15700712163717"></a>Start color: #f7ce00; end color: #f99b11</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p5700512173712"><a name="p5700512173712"></a><a name="p5700512173712"></a>Start color: #d1a738; end color: #eb933d</p>
</td>
</tr>
<tr id="row53180543816"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p931816516385"><a name="p931816516385"></a><a name="p931816516385"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p2590113224315"><a name="p2590113224315"></a><a name="p2590113224315"></a>Start color: #f76223; end color: #f2400a</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p153182553814"><a name="p153182553814"></a><a name="p153182553814"></a>Start color: #e67d50; end color: #d9542b</p>
</td>
</tr>
<tr id="row5161209163810"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p1616120910383"><a name="p1616120910383"></a><a name="p1616120910383"></a>2</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p91616973812"><a name="p91616973812"></a><a name="p91616973812"></a>Start color: #f772ac; end color: #e65392</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p2161189183817"><a name="p2161189183817"></a><a name="p2161189183817"></a>Start color: #d5749e; end color: #d6568d</p>
</td>
</tr>
<tr id="row956361913385"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p12563181918388"><a name="p12563181918388"></a><a name="p12563181918388"></a>3</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p25633192386"><a name="p25633192386"></a><a name="p25633192386"></a>Start color: #a575eb; end color: #a12df7</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p25631219183815"><a name="p25631219183815"></a><a name="p25631219183815"></a>Start color: #9973d1; end color: #5552d9</p>
</td>
</tr>
<tr id="row893012813389"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p1393092815385"><a name="p1393092815385"></a><a name="p1393092815385"></a>4</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p493092812387"><a name="p493092812387"></a><a name="p493092812387"></a>Start color: #7b79f7; end color: #4b48f7</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p6930228123813"><a name="p6930228123813"></a><a name="p6930228123813"></a>Start color: #7977d9; end color: #f99b11</p>
</td>
</tr>
<tr id="row11109426123812"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p1010912612382"><a name="p1010912612382"></a><a name="p1010912612382"></a>5</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p4109026173811"><a name="p4109026173811"></a><a name="p4109026173811"></a>Start color: #4b8af3; end color: #007dff</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p2109026173816"><a name="p2109026173816"></a><a name="p2109026173816"></a>Start color: #4c81d9; end color: #217bd9</p>
</td>
</tr>
<tr id="row1569813163818"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p196911318389"><a name="p196911318389"></a><a name="p196911318389"></a>6</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p186971323817"><a name="p186971323817"></a><a name="p186971323817"></a>Start color: #73c1e6; end color: #4fb4e3</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p169513183810"><a name="p169513183810"></a><a name="p169513183810"></a>Start color: #5ea6d1; end color: #4895c2</p>
</td>
</tr>
<tr id="row1428922313819"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p628912231384"><a name="p628912231384"></a><a name="p628912231384"></a>7</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p0289823193820"><a name="p0289823193820"></a><a name="p0289823193820"></a>Start color: #a5d61d; end color: #69d14f</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p12289192316386"><a name="p12289192316386"></a><a name="p12289192316386"></a>Start color: #91c23a; end color: #70ba5d</p>
</td>
</tr>
<tr id="row10565416153819"><td class="cellrowborder" valign="top" width="5.8205820582058205%" headers="mcps1.1.4.1.1 "><p id="p156516165388"><a name="p156516165388"></a><a name="p156516165388"></a>8</p>
</td>
<td class="cellrowborder" valign="top" width="41.7941794179418%" headers="mcps1.1.4.1.2 "><p id="p175652016143816"><a name="p175652016143816"></a><a name="p175652016143816"></a>Start color: #a2a2b0; end color: #8e8e93</p>
</td>
<td class="cellrowborder" valign="top" width="52.38523852385239%" headers="mcps1.1.4.1.3 "><p id="p5565101633813"><a name="p5565101633813"></a><a name="p5565101633813"></a>Start color: #8c8c99; end color: #6b6b76</p>
</td>
</tr>
</tbody>
</table>
For gauge charts, the following attribute is supported.
<a name="table591221715358"></a>
<table><thead align="left"><tr id="row7912417143518"><th class="cellrowborder" valign="top" width="23.52%" id="mcps1.1.6.1.1"><p id="p19912161763516"><a name="p19912161763516"></a><a name="p19912161763516"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="11.76%" id="mcps1.1.6.1.2"><p id="p11912151718350"><a name="p11912151718350"></a><a name="p11912151718350"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="11.72%" id="mcps1.1.6.1.3"><p id="p1791231713518"><a name="p1791231713518"></a><a name="p1791231713518"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8%" id="mcps1.1.6.1.4"><p id="p7913161710357"><a name="p7913161710357"></a><a name="p7913161710357"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="45%" id="mcps1.1.6.1.5"><p id="p9913111717353"><a name="p9913111717353"></a><a name="p9913111717353"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row99131917123518"><td class="cellrowborder" valign="top" width="23.52%" headers="mcps1.1.6.1.1 "><p id="p1091312179351"><a name="p1091312179351"></a><a name="p1091312179351"></a>percent</p>
</td>
<td class="cellrowborder" valign="top" width="11.76%" headers="mcps1.1.6.1.2 "><p id="p20913111723518"><a name="p20913111723518"></a><a name="p20913111723518"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="11.72%" headers="mcps1.1.6.1.3 "><p id="p891361723510"><a name="p891361723510"></a><a name="p891361723510"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8%" headers="mcps1.1.6.1.4 "><p id="p1913151711357"><a name="p1913151711357"></a><a name="p1913151711357"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.6.1.5 "><p id="p39134178350"><a name="p39134178350"></a><a name="p39134178350"></a>Percentage of the current value to the total value. The value ranges from 0 to 100.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table16167160154918"></a>
<table><thead align="left"><tr id="row916790104917"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p516718013494"><a name="p516718013494"></a><a name="p516718013494"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="p131682094915"><a name="p131682094915"></a><a name="p131682094915"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p1816816074917"><a name="p1816816074917"></a><a name="p1816816074917"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p81681406495"><a name="p81681406495"></a><a name="p81681406495"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p31682054916"><a name="p31682054916"></a><a name="p31682054916"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5168305498"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p816816014492"><a name="p816816014492"></a><a name="p816816014492"></a>stroke-width</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p5168160154919"><a name="p5168160154919"></a><a name="p5168160154919"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1116819014497"><a name="p1116819014497"></a><a name="p1116819014497"></a>32px (<strong id="b18760253113612"><a name="b18760253113612"></a><a name="b18760253113612"></a>gauge</strong> charts)</p>
<p id="p1616812094911"><a name="p1616812094911"></a><a name="p1616812094911"></a>24px (<strong id="b513445814226"><a name="b513445814226"></a><a name="b513445814226"></a>rainbow</strong> charts)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p171681805495"><a name="p171681805495"></a><a name="p171681805495"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p21684012495"><a name="p21684012495"></a><a name="p21684012495"></a>Width of the scale bar for <strong id="b87491134152415"><a name="b87491134152415"></a><a name="b87491134152415"></a>gauge</strong><span id="ph616840154918"><a name="ph616840154918"></a><a name="ph616840154918"></a>and <strong id="b125075528532"><a name="b125075528532"></a><a name="b125075528532"></a>rainbow</strong></span> charts.</p>
</td>
</tr>
<tr id="row1716813094910"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1916811017495"><a name="p1916811017495"></a><a name="p1916811017495"></a>start-angle</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p1416812019496"><a name="p1416812019496"></a><a name="p1416812019496"></a>&lt;deg&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p171685064917"><a name="p171685064917"></a><a name="p171685064917"></a>240 (<strong id="b261719915266"><a name="b261719915266"></a><a name="b261719915266"></a>gauge</strong> charts)</p>
<p id="p116813013494"><a name="p116813013494"></a><a name="p116813013494"></a>0 (<strong id="b87861144102514"><a name="b87861144102514"></a><a name="b87861144102514"></a>rainbow</strong> charts)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p15169180194910"><a name="p15169180194910"></a><a name="p15169180194910"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p7169800499"><a name="p7169800499"></a><a name="p7169800499"></a>Start angle of the scale bar for <strong id="b1609185210263"><a name="b1609185210263"></a><a name="b1609185210263"></a>gauge</strong><span id="ph41696012491"><a name="ph41696012491"></a><a name="ph41696012491"></a> and <strong id="b28951759171916"><a name="b28951759171916"></a><a name="b28951759171916"></a>rainbow</strong></span> charts, which starts from the direction of zero o'clock. The value ranges from 0 to 360.</p>
</td>
</tr>
<tr id="row11698018494"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p716950134916"><a name="p716950134916"></a><a name="p716950134916"></a>total-angle</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p161691012494"><a name="p161691012494"></a><a name="p161691012494"></a>&lt;deg&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p16169140134920"><a name="p16169140134920"></a><a name="p16169140134920"></a>240 (<strong id="b82262662820"><a name="b82262662820"></a><a name="b82262662820"></a>gauge</strong> charts)</p>
<p id="p5169170184918"><a name="p5169170184918"></a><a name="p5169170184918"></a>360 (<strong id="b664058172810"><a name="b664058172810"></a><a name="b664058172810"></a>rainbow</strong> charts)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p21699094912"><a name="p21699094912"></a><a name="p21699094912"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p31692011497"><a name="p31692011497"></a><a name="p31692011497"></a>Total length of the scale bar for <strong id="b4142940182820"><a name="b4142940182820"></a><a name="b4142940182820"></a>gauge</strong><span id="ph1016980124914"><a name="ph1016980124914"></a><a name="ph1016980124914"></a> and <strong id="b1867663912208"><a name="b1867663912208"></a><a name="b1867663912208"></a>rainbow</strong></span> charts. The value ranges from –360 to 360. A negative number indicates the anticlockwise direction.</p>
</td>
</tr>
<tr id="row141698034916"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p181694074916"><a name="p181694074916"></a><a name="p181694074916"></a>center-x</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p181691305493"><a name="p181691305493"></a><a name="p181691305493"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1716980174916"><a name="p1716980174916"></a><a name="p1716980174916"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p81695024910"><a name="p81695024910"></a><a name="p81695024910"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1416960174911"><a name="p1416960174911"></a><a name="p1416960174911"></a>Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the <strong id="b1116220342476"><a name="b1116220342476"></a><a name="b1116220342476"></a>position</strong> style in the common styles, and must be used together with <strong id="b382682912114"><a name="b382682912114"></a><a name="b382682912114"></a>center-y</strong> and <strong id="b1482811294120"><a name="b1482811294120"></a><a name="b1482811294120"></a>radius</strong>. This style is supported by the gauge chart only.</p>
</td>
</tr>
<tr id="row3169150184914"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p7169002498"><a name="p7169002498"></a><a name="p7169002498"></a>center-y</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p17170406499"><a name="p17170406499"></a><a name="p17170406499"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p121705094916"><a name="p121705094916"></a><a name="p121705094916"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p191706020496"><a name="p191706020496"></a><a name="p191706020496"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p18170170194913"><a name="p18170170194913"></a><a name="p18170170194913"></a>Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the <strong id="b1629744408"><a name="b1629744408"></a><a name="b1629744408"></a>position</strong> style in the common styles, and must be used together with <strong id="b02839331014"><a name="b02839331014"></a><a name="b02839331014"></a>center-x</strong> and <strong id="b1928518331711"><a name="b1928518331711"></a><a name="b1928518331711"></a>radius</strong>. This style is supported by the gauge chart only.</p>
</td>
</tr>
<tr id="row6170208490"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1317016019498"><a name="p1317016019498"></a><a name="p1317016019498"></a>radius</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p1717012014495"><a name="p1717012014495"></a><a name="p1717012014495"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1317019013497"><a name="p1317019013497"></a><a name="p1317019013497"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1717013074913"><a name="p1717013074913"></a><a name="p1717013074913"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p7170507496"><a name="p7170507496"></a><a name="p7170507496"></a>Radius of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the <strong id="b91381042517"><a name="b91381042517"></a><a name="b91381042517"></a>width</strong> and <strong id="b10941110165113"><a name="b10941110165113"></a><a name="b10941110165113"></a>height</strong> in the common styles, and must be used together with <strong id="b569715431526"><a name="b569715431526"></a><a name="b569715431526"></a>center-x</strong> and <strong id="b1370511431924"><a name="b1370511431924"></a><a name="b1370511431924"></a>center-y</strong>. This style is supported by the gauge chart only.</p>
</td>
</tr>
<tr id="row121701019491"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p181706004913"><a name="p181706004913"></a><a name="p181706004913"></a>colors</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p017013014920"><a name="p017013014920"></a><a name="p017013014920"></a>Array</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1417012054917"><a name="p1417012054917"></a><a name="p1417012054917"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p10170130184918"><a name="p10170130184918"></a><a name="p10170130184918"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1817012014490"><a name="p1817012014490"></a><a name="p1817012014490"></a>Color of each section for the scale bar of the gauge component.</p>
<p id="p1617017094918"><a name="p1617017094918"></a><a name="p1617017094918"></a>For example,<strong id="b1786062281317"><a name="b1786062281317"></a><a name="b1786062281317"></a> colors: #ff0000, #00ff00</strong>. This style is supported by the gauge chart only.</p>
</td>
</tr>
<tr id="row101710024913"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p141715084914"><a name="p141715084914"></a><a name="p141715084914"></a>weights</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p20171201495"><a name="p20171201495"></a><a name="p20171201495"></a>Array</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1117140144911"><a name="p1117140144911"></a><a name="p1117140144911"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p71716012490"><a name="p71716012490"></a><a name="p71716012490"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p3171160114915"><a name="p3171160114915"></a><a name="p3171160114915"></a>Weight of each section for the scale bar of the gauge component.</p>
<p id="p2171140124910"><a name="p2171140124910"></a><a name="p2171140124910"></a>For example, weights: 2, 2. This style is supported by the gauge chart only.</p>
</td>
</tr>
<tr id="row6171100114916"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p117115044916"><a name="p117115044916"></a><a name="p117115044916"></a>font-family<sup id="sup111711400490"><a name="sup111711400490"></a><a name="sup111711400490"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p917160104910"><a name="p917160104910"></a><a name="p917160104910"></a>Array</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p117113014494"><a name="p117113014494"></a><a name="p117113014494"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p517117018496"><a name="p517117018496"></a><a name="p517117018496"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1417110074919"><a name="p1417110074919"></a><a name="p1417110074919"></a>Font style of the description text. You can use <a href="js-components-common-customizing-font.md">Custom Font Styles</a>.</p>
</td>
</tr>
<tr id="row1117115018499"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p151710024910"><a name="p151710024910"></a><a name="p151710024910"></a>font-size<sup id="sup917220194912"><a name="sup917220194912"></a><a name="sup917220194912"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p01728014915"><a name="p01728014915"></a><a name="p01728014915"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p5172120114913"><a name="p5172120114913"></a><a name="p5172120114913"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p71729010499"><a name="p71729010499"></a><a name="p71729010499"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1517210104914"><a name="p1517210104914"></a><a name="p1517210104914"></a>Font size of the description text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section749131815264"></a>
Events in [Universal Events](js-components-common-events.md) are supported.
## Methods<a name="section4480852195018"></a>
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported.
<a name="table7480052145013"></a>
<table><thead align="left"><tr id="row64801152175016"><th class="cellrowborder" valign="top" width="8.630863086308631%" id="mcps1.1.4.1.1"><p id="p184801352105010"><a name="p184801352105010"></a><a name="p184801352105010"></a>Method</p>
</th>
<th class="cellrowborder" valign="top" width="58.035803580358035%" id="mcps1.1.4.1.2"><p id="p134801052175010"><a name="p134801052175010"></a><a name="p134801052175010"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.1.4.1.3"><p id="p3480452115015"><a name="p3480452115015"></a><a name="p3480452115015"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1148112528509"><td class="cellrowborder" valign="top" width="8.630863086308631%" headers="mcps1.1.4.1.1 "><p id="p548115219507"><a name="p548115219507"></a><a name="p548115219507"></a>append</p>
</td>
<td class="cellrowborder" valign="top" width="58.035803580358035%" headers="mcps1.1.4.1.2 "><p id="p9481135295014"><a name="p9481135295014"></a><a name="p9481135295014"></a>{</p>
<p id="p1348165210500"><a name="p1348165210500"></a><a name="p1348165210500"></a>serial: number, // Set the data subscript of the line chart to be updated.</p>
<p id="p15481175285010"><a name="p15481175285010"></a><a name="p15481175285010"></a>data: Array&lt;number&gt;, // Set the new data.</p>
<p id="p948113523503"><a name="p948113523503"></a><a name="p948113523503"></a>}</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p7481952105010"><a name="p7481952105010"></a><a name="p7481952105010"></a>Data is dynamically added to an existing data sequence. The target sequence is specified based on <strong id="b181361720173312"><a name="b181361720173312"></a><a name="b181361720173312"></a>serial</strong>, which is the subscript of the datasets array and starts from 0. <strong id="b2513193515314"><a name="b2513193515314"></a><a name="b2513193515314"></a>datasets[index].data</strong> is not updated. Only line charts support this attribute. The value is incremented by 1 based on the horizontal coordinate and is related to the <strong id="b16836711978"><a name="b16836711978"></a><a name="b16836711978"></a>xAxis min/max</strong> setting.</p>
</td>
</tr>
</tbody>
</table>
## Example Code<a name="section164885329456"></a>
1. Line chart
```
<!-- xxx.hml -->
<div class="container">
<stack class="chart-region">
<image class="chart-background" src="common/background.png"></image>
<chart class="chart-data" type="line" ref="linechart" options="{{lineOps}}" datasets="{{lineData}}"></chart>
</stack>
<button value="Add data" onclick="addData"></button>
</div>
```
```
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.chart-region {
height: 400px;
width: 700px;
}
.chart-background {
object-fit: fill;
}
.chart-data {
width: 700px;
height: 600px;
}
button {
width: 100%;
height: 50px;
background-color: #F4F2F1;
text-color: #0C81F3;
}
```
``` ## Child Components
// xxx.js
export default {
data: {
lineData: [
{
strokeColor: '#0081ff',
fillColor: '#cce5ff',
data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628, 791, 505, 613, 575, 475, 553, 491, 680, 657, 716],
gradient: true,
}
],
lineOps: {
xAxis: {
min: 0,
max: 20,
display: false,
},
yAxis: {
min: 0,
max: 1000,
display: false,
},
series: {
lineStyle: {
width: "5px",
smooth: true,
},
headPoint: {
shape: "circle",
size: 20,
strokeWidth: 5,
fillColor: '#ffffff',
strokeColor: '#007aff',
display: true,
},
loop: {
margin: 2,
gradient: true,
}
}
},
},
addData() {
this.$refs.linechart.append({
serial: 0,
data: [Math.floor(Math.random() * 400) + 400]
})
}
}
```
![](figures/en-us_image_0000001173324843.png) Not supported
2. Bar chart
``` ## Attributes
<!-- xxx.hml -->
<div class="container"> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<stack class="data-region">
<image class="data-background" src="common/background.png"></image> | Name | Type | Default Value | Mandatory | Description |
<chart class="data-bar" type="bar" id="bar-chart" options="{{barOps}}" datasets="{{barData}}"></chart> | ------------------------------ | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
</stack> | type | string | line | No | Chart type. Dynamic modification is not supported. Available values include:<br>- **bar**: bar chart.<br>- **line**: line chart.<br>- **gauge**: gauge chart.<br>- **progress**<sup>5+</sup>: circle chart of progresses.<br>- **loading**<sup>5+</sup>: circle chart of loading processes.<br>- **rainbow**<sup>5+</sup>: circle chart of proportions.|
</div> | options | ChartOptions | - | No | Chart parameters. You must set parameters for bar charts and line charts. Parameter settings for gauge charts do not take effect. You can set the minimum value, maximum value, scale, and line width of the x-axis or y-axis, whether to display the x-axis and y-axis, and whether the line is smooth. Dynamic modification is not supported.|
``` | datasets | Array&lt;ChartDataset&gt; | - | No | Data sets. You must set data sets for bar charts and line charts. Data sets for a gauge chart do not take effect. You can set multiple datasets and their background colors.|
| segments<sup>5+</sup> | DataSegment \| Array&lt;DataSegment&gt; | - | No | Data structures used by **progress**, **loading**, and **rainbow** charts.<br>**DataSegment** is available for **progress** and **loading** charts.<br>**Array&lt;DataSegment&gt;** is available for **rainbow** charts. A maximum of nine **DataSegment**s are supported in the array.|
| effects<sup>5+</sup> | boolean | true | No | Whether to enable the effects for **progress** and **rainbow** charts. |
| animationduration<sup>6+</sup> | number | 3000 | No | Animation duration for expanding a **rainbow** chart, in milliseconds. |
**Table 1** ChartOptions
| Name | Type | Default Value | Mandatory | Description |
| ------ | ----------- | ---- | ---- | ---------------------------------------- |
| xAxis | ChartAxis | - | Yes | X-axis parameters. You can set the minimum value, maximum value, and scale of the x-axis, and whether to display the x-axis. |
| yAxis | ChartAxis | - | Yes | Y-axis parameters. You can set the minimum value, maximum value, and scale of the y-axis, and whether to display the y-axis. |
| series | ChartSeries | - | No | Data sequence parameters. Only line charts support this attribute.<br>- Line style, such as the line width and whether the line is smooth.<br>- Style and size of the white point at the start of the line.|
``` **Table 2** ChartDataset
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.data-region {
height: 400px;
width: 700px;
}
.data-background {
object-fit: fill;
}
.data-bar {
width: 700px;
height: 400px;
}
```
``` | Name | Type | Default Value | Mandatory | Description |
// xxx.js | ----------- | ---------------------------------------- | -------- | ---- | ---------------------- |
export default { | strokeColor | &lt;color&gt; | \#ff6384 | No | Stroke color. Only line charts support this attribute. |
data: { | fillColor | &lt;color&gt; | \#ff6384 | No | Fill color.<br>For line charts, the value indicates the gradient color to fill.|
barData: [ | data | Array&lt;number&gt; \| Array&lt;Point&gt;<sup>5+</sup> | - | Yes | Data of the drawn line or bar. |
{ | gradient | boolean | false | No | Whether to display the gradient color. Only line charts support this attribute. |
fillColor: '#f07826',
data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628], **Table 3** ChartAxis
},
{ | Name | Type | Default Value | Mandatory | Description |
fillColor: '#cce5ff', | -------- | ------------- | -------- | ---- | ---------------------------------------- |
data: [535, 776, 615, 444, 694, 785, 677, 609, 562, 410], | min | number | 0 | No | Minimum value of the axis. Only line charts support negative numbers. |
}, | max | number | 100 | No | Maximum value of the axis. Only line charts support negative numbers. |
{ | axisTick | number | 10 | No | Number of scales displayed on the axis. The value ranges from 1 to 20. The display effect depends on the calculation result of Number of pixels occupied by the image width/(**max****min**).<br>In the bar chart, the number of bars in each group of data is the same as the number of scales, and the bars are displayed at the scales.|
fillColor: '#ff88bb', | display | boolean | false | No | Whether to display the axis. |
data: [673, 500, 574, 483, 702, 583, 437, 506, 693, 657], | color | &lt;color&gt; | \#c0c0c0 | No | Axis color. |
},
],
barOps: {
xAxis: {
min: 0,
max: 20,
display: false,
axisTick: 10,
},
yAxis: {
min: 0,
max: 1000,
display: false,
},
},
}
}
```
![](figures/en-us_image_0000001173164929.png) **Table 4** ChartSeries
3. Gauge chart | Name | Type | Default Value | Mandatory | Description |
| ----------- | -------------- | ---- | ---- | -------------------- |
| lineStyle | ChartLineStyle | - | No | Line style, such as the line width and whether the line is smooth. |
| headPoint | PointStyle | - | No | Style and size of the white point at the start of the line. |
| topPoint | PointStyle | - | No | Style and size of the top point. |
| bottomPoint | PointStyle | - | No | Style and size of the bottom point. |
| loop | ChartLoop | - | No | Whether to start drawing again when the screen is looped.|
``` **Table 5** ChartLineStyle
<!-- xxx.hml -->
<div class="container">
<div class="gauge-region">
<chart class="data-gauge" type="gauge" percent = "50"></chart>
</div>
</div>
```
``` | Name | Type | Default Value | Mandatory | Description |
/* xxx.css */ | ------ | -------------- | ----- | ---- | ----- |
.container { | width | &lt;length&gt; | 1px | No | Line width.|
flex-direction: column; | smooth | boolean | false | No | Whether the line is smooth.|
justify-content: center;
align-items: center;
}
.gauge-region {
height: 400px;
width: 400px;
}
.data-gauge {
colors: #83f115, #fd3636, #3bf8ff;
weights: 4, 2, 1;
}
```
![](figures/en-us_image_0000001127125264.png) **Table 6** PointStyle
| Name | Type | Default Value | Mandatory | Description |
| ----------- | -------------- | -------- | ---- | ---------------------------------------- |
| shape | string | circle | No | Shape of the highlight point. Available values are as follows:<br>- circle<br>- square<br>- triangle|
| size | &lt;length&gt; | 5px | No | Size of the highlight point. |
| strokeWidth | &lt;length&gt; | 1px | No | Stroke width. |
| strokeColor | &lt;color&gt; | \#ff0000 | No | Stroke color. |
| fillColor | &lt;color&gt; | \#ff0000 | No | Fill color. |
**Table 7** ChartLoop
| Name | Type | Default Value | Mandatory | Description |
| -------- | -------------- | ----- | ---- | ---------------------------------------- |
| margin | &lt;length&gt; | 1 | No | Number of erased points (horizontal distance between the latest drawn point and the earliest point). You are not advised to use **margin** together with **topPoint**, **bottomPoint**, or **headPoint** for mini-, small- and standard-system devices. If you do so, there is a possibility that the point is in the erase area and invisible.|
| gradient | boolean | false | No | Whether to perform gradient erase. |
**Table 8** Point<sup>5+</sup>
| Name | Type | Default Value | Mandatory | Description |
| ------------ | ------------- | -------- | ---- | ---------------------------------------- |
| value | number | 0 | Yes | Y coordinate of the point to draw. |
| pointStyle | PointStyle | - | No | Style of the point. |
| description | string | - | No | Description text of the point. |
| textLocation | string | - | No | Position of the description text relative to the point. Available values are as follows: **top**: above the point<br>**bottom**: below the point<br>**none**: not displayed|
| textColor | &lt;color&gt; | \#000000 | No | Color of the description text. |
| lineDash | string | solid | No | Dashed line pattern. You can set the dash length and space length between the dashes. For example, **"dashed, 5, 5"** indicates a dashed line with each dash in 5 px and a 5 px space between each two dashes. Default value **"solid"** indicates a solid line.|
| lineColor | &lt;color&gt; | \#000000 | No | Line color. If this attribute is not set, the value of **strokeColor** is used. |
**Table 9** DataSegment<sup>5+</sup>
| Name | Type | Default Value | Mandatory | Description |
| ---------- | ------ | ---- | ---- | ---------------------------------------- |
| startColor | Color | - | No | Color of the start position. If this attribute is set, **endColor** must be set. If this attribute is not set, the default color array preset in the system is used. For details about the color values, see the next table.|
| endColor | Color | - | No | Color of the end position. If this attribute is set, **startColor** must be set.<br>If this attribute is not set, the default color array preset in the system is used.|
| value | number | 0 | Yes | Percentage for the data segment. The maximum value is **100**. |
| name | string | - | No | Name of the data segment. |
| Data Segment | Light Mode | Dark Mode |
| ---- | --------------------------- | --------------------------- |
| 0 | Start color: \#f7ce00; end color: \#f99b11| Start color: \#d1a738; end color: \#eb933d|
| 1 | Start color: \#f76223; end color: \#f2400a| Start color: \#e67d50; end color: \#d9542b|
| 2 | Start color: \#f772ac; end color: \#e65392| Start color: \#d5749e; end color: \#d6568d|
| 3 | Start color: \#a575eb; end color: \#a12df7| Start color: \#9973d1; end color: \#5552d9|
| 4 | Start color: \#7b79f7; end color: \#4b48f7| Start color: \#7977d9; end color: \#f99b11|
| 5 | Start color: \#4b8af3; end color: \#007dff| Start color: \#4c81d9; end color: \#217bd9|
| 6 | Start color: \#73c1e6; end color: \#4fb4e3| Start color: \#5ea6d1; end color: \#4895c2|
| 7 | Start color: \#a5d61d; end color: \#69d14f| Start color: \#91c23a; end color: \#70ba5d|
| 8 | Start color: \#a2a2b0; end color: \#8e8e93| Start color: \#8c8c99; end color: \#6b6b76|
For the **gauge** charts, the following attributes are also supported.
| Name | Type | Default Value | Mandatory | Description |
| ------- | ------ | ---- | ---- | ---------------------- |
| percent | number | 0 | No | Percentage of the current value to the total value. The value ranges from 0 to 100.|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------------------------ | -------------- | -------------------------- | ---- | ---------------------------------------- |
| stroke-width | &lt;length&gt; | 32px (**gauge** charts)<br>24px (**rainbow** charts)| No | Width of the scale bar for **gauge** and **rainbow** charts. |
| start-angle | &lt;deg&gt; | 240 (**gauge** charts)<br>0 (**rainbow** charts) | No | Start angle of the scale bar for **gauge** and **rainbow** charts, which starts from zero o'clock. The value ranges from 0 to 360. |
| total-angle | &lt;deg&gt; | 240 (**gauge** charts)<br>360 (**rainbow** charts) | No | Total length of the scale bar for **gauge** and **rainbow** charts. The value ranges from –360 to 360. A negative number indicates the anticlockwise direction.|
| center-x | &lt;length&gt; | - | No | Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **position** style in the common styles, and must be used together with **center-y** and **radius**. This style is supported by the gauge chart only.|
| center-y | &lt;length&gt; | - | No | Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **position** style in the common styles, and must be used together with **center-x** and **radius**. This style is supported by the gauge chart only.|
| radius | &lt;length&gt; | - | No | Radius of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **width** and **height** in the common styles, and must be used together with **center-x** and **center-y**. This style is supported by the gauge chart only.|
| colors | Array | - | No | Color of each section for the scale bar of the gauge component.<br>For example, **colors: \#ff0000, #00ff00**. This style is supported by the gauge chart only.|
| weights | Array | - | No | Weight of each section for the scale bar of the gauge component.<br>For example, **weights: 2, 2**. This style is supported by the gauge chart only.|
| font-family<sup>5+</sup> | Array | - | No | Font style of the description text. You can use a [custom font](../arkui-js/js-components-common-customizing-font.md).|
| font-size<sup>5+</sup> | &lt;length&gt; | - | No | Font size of the description text. |
## Events
The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ---------------------------------------- |
| append | {<br>serial: number, // Set the data subscript of the line chart to be updated.<br>data: Array&lt;number&gt;, // Set the new data.<br>} | Data is dynamically added to an existing data sequence. The target sequence is specified based on **serial**, which is the subscript of the datasets array and starts from 0. **datasets[index].data** is not updated. Only line charts support this attribute. The value is incremented by 1 based on the horizontal coordinate and is related to the **xAxis min/max** setting.|
## Example
1. Line chart
```html
<!-- xxx.hml -->
<div class="container">
<stack class="chart-region">
<image class="chart-background" src="common/background.png"></image>
<chart class="chart-data" type="line" ref="linechart" options="{{lineOps}}" datasets="{{lineData}}"></chart>
</stack>
<button value="Add data" onclick="addData"></button>
</div>
```
```css
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.chart-region {
height: 400px;
width: 700px;
}
.chart-background {
object-fit: fill;
}
.chart-data {
width: 700px;
height: 600px;
}
button {
width: 100%;
height: 50px;
background-color: #F4F2F1;
text-color: #0C81F3;
}
```
```js
// xxx.js
export default {
data: {
lineData: [
{
strokeColor: '#0081ff',
fillColor: '#cce5ff',
data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628, 791, 505, 613, 575, 475, 553, 491, 680, 657, 716],
gradient: true,
}
],
lineOps: {
xAxis: {
min: 0,
max: 20,
display: false,
},
yAxis: {
min: 0,
max: 1000,
display: false,
},
series: {
lineStyle: {
width: "5px",
smooth: true,
},
headPoint: {
shape: "circle",
size: 20,
strokeWidth: 5,
fillColor: '#ffffff',
strokeColor: '#007aff',
display: true,
},
loop: {
margin: 2,
gradient: true,
}
}
},
},
addData() {
this.$refs.linechart.append({
serial: 0,
data: [Math.floor(Math.random() * 400) + 400]
})
}
}
```
![en-us_image_0000001173324843](figures/en-us_image_0000001173324843.png)
2. Bar chart
```html
<!-- xxx.hml -->
<div class="container">
<stack class="data-region">
<image class="data-background" src="common/background.png"></image>
<chart class="data-bar" type="bar" id="bar-chart" options="{{barOps}}" datasets="{{barData}}"></chart>
</stack>
</div>
```
```css
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.data-region {
height: 400px;
width: 700px;
}
.data-background {
object-fit: fill;
}
.data-bar {
width: 700px;
height: 400px;
}
```
```js
// xxx.js
export default {
data: {
barData: [
{
fillColor: '#f07826',
data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628],
},
{
fillColor: '#cce5ff',
data: [535, 776, 615, 444, 694, 785, 677, 609, 562, 410],
},
{
fillColor: '#ff88bb',
data: [673, 500, 574, 483, 702, 583, 437, 506, 693, 657],
},
],
barOps: {
xAxis: {
min: 0,
max: 20,
display: false,
axisTick: 10,
},
yAxis: {
min: 0,
max: 1000,
display: false,
},
},
}
}
```
![en-us_image_0000001173164929](figures/en-us_image_0000001173164929.png)
3. Gauge chart
```html
<!-- xxx.hml -->
<div class="container">
<div class="gauge-region">
<chart class="data-gauge" type="gauge" percent = "50"></chart>
</div>
</div>
```
```css
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.gauge-region {
height: 400px;
width: 400px;
}
.data-gauge {
colors: #83f115, #fd3636, #3bf8ff;
weights: 4, 2, 1;
}
```
![en-us_image_0000001127125264](figures/en-us_image_0000001127125264.png)
# divider<a name="EN-US_TOPIC_0000001127125060"></a> # divider
The **<divider\>** component is used to separate content blocks and content elements. It can be used for the list or UI layout. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<divider>** component is used to separate content blocks and content elements. It can be used for the list or UI layout.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
## Attributes
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p> | Name | Type | Default Value | Mandatory | Description |
</th> | -------- | ------- | ----- | ---- | -------------------- |
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p> | vertical | boolean | false | No | Whether to use the vertical divider. The default value is **false**, indicating that the horizontal divider is used.|
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p> > **NOTE**
</th> >
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p> > The **focusable** and **disabled** attributes are not supported.
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th> ## Styles
</tr>
</thead> Only the following styles are supported.
<tbody><tr id="row14446349178"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p15694934121713"><a name="p15694934121713"></a><a name="p15694934121713"></a>vertical</p>
</td> | Name | Type | Default Value | Mandatory | Description |
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p0694434171720"><a name="p0694434171720"></a><a name="p0694434171720"></a>boolean</p> | --------------------------------- | -------------- | ---------- | ---- | ---------------------------------------- |
</td> | margin | &lt;length&gt; | 0 | No | Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values: |
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p2694103415179"><a name="p2694103415179"></a><a name="p2694103415179"></a>false</p> | margin-[left\|top\|right\|bottom] | &lt;length&gt; | 0 | No | Shorthand attribute of the length type to set left, top, right, and bottom margins attributes. Its unit is px and default value is **0**.|
</td> | color | &lt;color&gt; | \#08000000 | No | Color of the divider. |
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p13694103471711"><a name="p13694103471711"></a><a name="p13694103471711"></a>No</p> | stroke-width | &lt;length&gt; | 1 | No | Width of the divider. |
</td> | display | string | flex | No | Type of the bounding box generated by the divider. The value can be **flex** or **none**. The default value is **flex**. |
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1769433401719"><a name="p1769433401719"></a><a name="p1769433401719"></a>Whether to use the vertical divider. The default value is <strong id="b8204122145214"><a name="b8204122145214"></a><a name="b8204122145214"></a>false</strong>, indicating that the horizontal divider is used.</p> | visibility | string | visible | No | Whether to display the divider. Invisible dividers also occupy space. **visible** indicates that the divider is displayed, and **hidden** indicates that the divider is not displayed.|
</td> | line-cap | string | butt | No | Cap style of the divider. The default value is **butt**. Available values are as follows:<br>- **butt**: The ends of the divider are squared off.<br>- **round**: A rounded cap is added to each end of the divider. The divider length will increase by the stroke width.<br>- **square**: A square cap is added to each end of the divider. The divider length will increase by the stroke width.|
</tr> | flex | number | - | No | How to divide available space of the parent component for each child component. This is a shorthand attribute to set the **flex-grow** attribute.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.|
</tbody> | flex-grow | number | 0 | No | How much a child component will grow. The value specifies allocation of the available space on the main axis of the parent component. Size of available space = Container size - Total size of all child components. Value **0** indicates that the child component does not grow.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.|
</table> | flex-shrink | number | 1 | No | How much a child component will shrink. The shrink occurs only when the sum of default element widths is greater than that of the parent component. Value **0** indicates that the child component does not shrink.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.|
| flex-basis | &lt;length&gt; | - | No | Initial length of a child component on the main axis.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.|
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The **focusable** and **disabled** attributes are not supported.
## Events
## Styles<a name="section5775351116"></a>
Only the following style attributes are supported.
<a name="table156669187471"></a>
<table><thead align="left"><tr id="row966601820476"><th class="cellrowborder" valign="top" width="18.209640397857694%" id="mcps1.1.6.1.1"><p id="p1366616188472"><a name="p1366616188472"></a><a name="p1366616188472"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="14.135424636572303%" id="mcps1.1.6.1.2"><p id="p26661418194711"><a name="p26661418194711"></a><a name="p26661418194711"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="22.083014537107886%" id="mcps1.1.6.1.3"><p id="p36661718194710"><a name="p36661718194710"></a><a name="p36661718194710"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.7999234889058915%" id="mcps1.1.6.1.4"><p id="p16666141812475"><a name="p16666141812475"></a><a name="p16666141812475"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="38.77199693955624%" id="mcps1.1.6.1.5"><p id="p16667718174712"><a name="p16667718174712"></a><a name="p16667718174712"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row186671218144718"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p666720180479"><a name="p666720180479"></a><a name="p666720180479"></a>margin</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p666714189478"><a name="p666714189478"></a><a name="p666714189478"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p18667181834719"><a name="p18667181834719"></a><a name="p18667181834719"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p9667171834720"><a name="p9667171834720"></a><a name="p9667171834720"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p8667191824717"><a name="p8667191824717"></a><a name="p8667191824717"></a>Shorthand attribute to set all margins in a declaration. You can set 1 to 4 values.</p>
</td>
</tr>
<tr id="row1758549135917"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="a70939a36b2b04dd8bec21f5bddc8637e"><a name="a70939a36b2b04dd8bec21f5bddc8637e"></a><a name="a70939a36b2b04dd8bec21f5bddc8637e"></a>margin-[left|top|right|bottom]</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="ae53ac9ac370d483990e04ea9789c1e49"><a name="ae53ac9ac370d483990e04ea9789c1e49"></a><a name="ae53ac9ac370d483990e04ea9789c1e49"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="a180cd037e6174e5c82f35a3a66b6f2ec"><a name="a180cd037e6174e5c82f35a3a66b6f2ec"></a><a name="a180cd037e6174e5c82f35a3a66b6f2ec"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="a487d09add6e54c5c89fa4f22e9318271"><a name="a487d09add6e54c5c89fa4f22e9318271"></a><a name="a487d09add6e54c5c89fa4f22e9318271"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p696123114464"><a name="p696123114464"></a><a name="p696123114464"></a>Shorthand attribute of the length type to set left, top, right, and bottom margins attributes. Its unit is px and default value is <strong id="b115244118529"><a name="b115244118529"></a><a name="b115244118529"></a>0</strong>.</p>
</td>
</tr>
<tr id="row1487514596294"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p71673109308"><a name="p71673109308"></a><a name="p71673109308"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p516781011309"><a name="p516781011309"></a><a name="p516781011309"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p416718104300"><a name="p416718104300"></a><a name="p416718104300"></a>#08000000</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p1016741053017"><a name="p1016741053017"></a><a name="p1016741053017"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p116711013301"><a name="p116711013301"></a><a name="p116711013301"></a>Color of the divider.</p>
</td>
</tr>
<tr id="row1055218083014"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p10167710193019"><a name="p10167710193019"></a><a name="p10167710193019"></a>stroke-width</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p6167121093018"><a name="p6167121093018"></a><a name="p6167121093018"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p31671010113017"><a name="p31671010113017"></a><a name="p31671010113017"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p3167181019303"><a name="p3167181019303"></a><a name="p3167181019303"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p13167101016307"><a name="p13167101016307"></a><a name="p13167101016307"></a>Width of the divider.</p>
</td>
</tr>
<tr id="row56167193020"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p161695103305"><a name="p161695103305"></a><a name="p161695103305"></a>display</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p34141720115716"><a name="p34141720115716"></a><a name="p34141720115716"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p17169310133020"><a name="p17169310133020"></a><a name="p17169310133020"></a>flex</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p3169101019308"><a name="p3169101019308"></a><a name="p3169101019308"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p1416912102303"><a name="p1416912102303"></a><a name="p1416912102303"></a>Type of the bounding box generated by the divider. The value can be <strong id="b54008818310"><a name="b54008818310"></a><a name="b54008818310"></a>flex</strong> or <strong id="b12400188103111"><a name="b12400188103111"></a><a name="b12400188103111"></a>none</strong>. The default value is <strong id="b134003817319"><a name="b134003817319"></a><a name="b134003817319"></a>flex</strong>.</p>
</td>
</tr>
<tr id="row1836619303"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p81691410143017"><a name="p81691410143017"></a><a name="p81691410143017"></a>visibility</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p51691710173018"><a name="p51691710173018"></a><a name="p51691710173018"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p14169101053017"><a name="p14169101053017"></a><a name="p14169101053017"></a>visible</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p1016919104306"><a name="p1016919104306"></a><a name="p1016919104306"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p13169101011309"><a name="p13169101011309"></a><a name="p13169101011309"></a>Whether to display the divider. Invisible dividers also occupy space. <strong id="b9290124115011"><a name="b9290124115011"></a><a name="b9290124115011"></a>visible</strong> indicates that the divider is displayed, and <strong id="b571315351925"><a name="b571315351925"></a><a name="b571315351925"></a>hidden</strong> indicates that the divider is not displayed.</p>
</td>
</tr>
<tr id="row19262114111135"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="p1126317411138"><a name="p1126317411138"></a><a name="p1126317411138"></a>line-cap</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p13140171172312"><a name="p13140171172312"></a><a name="p13140171172312"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="p926310414130"><a name="p926310414130"></a><a name="p926310414130"></a>butt</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p172631041181314"><a name="p172631041181314"></a><a name="p172631041181314"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p1826374117137"><a name="p1826374117137"></a><a name="p1826374117137"></a>Cap style of the divider. The default value is <strong id="b11938171773415"><a name="b11938171773415"></a><a name="b11938171773415"></a>butt</strong>. Available values are as follows:</p>
<a name="ul169886211615"></a><a name="ul169886211615"></a><ul id="ul169886211615"><li><strong id="b097794943310"><a name="b097794943310"></a><a name="b097794943310"></a>butt</strong>: The ends of the divider are squared off.</li><li><strong id="b579115410335"><a name="b579115410335"></a><a name="b579115410335"></a>round</strong>: A rounded cap is added to each end of the divider.</li><li><strong id="b196977590336"><a name="b196977590336"></a><a name="b196977590336"></a>square</strong>: A square cap is added to each end of the divider.</li></ul>
<div class="note" id="note46927357715"><a name="note46927357715"></a><a name="note46927357715"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p126922351571"><a name="p126922351571"></a><a name="p126922351571"></a>If the value is <strong id="b11815103163413"><a name="b11815103163413"></a><a name="b11815103163413"></a>round</strong> or <strong id="b31272793415"><a name="b31272793415"></a><a name="b31272793415"></a>square</strong>, the line length increases by the line width.</p>
</div></div>
</td>
</tr>
<tr id="row3222184412411"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="ad74a6a48aca7439e9344c18c26b4177e"><a name="ad74a6a48aca7439e9344c18c26b4177e"></a><a name="ad74a6a48aca7439e9344c18c26b4177e"></a>flex</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="a2e6e5192a1534872be5fcfd9f83e3fdc"><a name="a2e6e5192a1534872be5fcfd9f83e3fdc"></a><a name="a2e6e5192a1534872be5fcfd9f83e3fdc"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="a8512eda38e25410685be8a8992890257"><a name="a8512eda38e25410685be8a8992890257"></a><a name="a8512eda38e25410685be8a8992890257"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p14201322964"><a name="p14201322964"></a><a name="p14201322964"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p368291715615"><a name="p368291715615"></a><a name="p368291715615"></a>How to divide available space of the parent component for each child component. This is a shorthand attribute to set the <strong id="b065931874612"><a name="b065931874612"></a><a name="b065931874612"></a>flex-grow</strong> attribute.</p>
<div class="note" id="note1368217171461"><a name="note1368217171461"></a><a name="note1368217171461"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p76821817460"><a name="p76821817460"></a><a name="p76821817460"></a>This attribute takes effect only when the parent component is <strong id="b11480192416462"><a name="b11480192416462"></a><a name="b11480192416462"></a>&lt;div&gt;</strong>, <strong id="b4481624124614"><a name="b4481624124614"></a><a name="b4481624124614"></a>&lt;list-item&gt;</strong>, or <strong id="b448116241468"><a name="b448116241468"></a><a name="b448116241468"></a>&lt;tabs&gt;</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row879744718418"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="a5d88cacaaf5c4f6a87390ab916b695c6"><a name="a5d88cacaaf5c4f6a87390ab916b695c6"></a><a name="a5d88cacaaf5c4f6a87390ab916b695c6"></a>flex-grow</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="a2c379e3af283446da446f1631e572efd"><a name="a2c379e3af283446da446f1631e572efd"></a><a name="a2c379e3af283446da446f1631e572efd"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="aa374f6c7415a4ee48a06930d76c55be7"><a name="aa374f6c7415a4ee48a06930d76c55be7"></a><a name="aa374f6c7415a4ee48a06930d76c55be7"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p1335271877"><a name="p1335271877"></a><a name="p1335271877"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p13246193876"><a name="p13246193876"></a><a name="p13246193876"></a>How much a child component will grow. The value specifies allocation of the remaining space on the main axis of the parent component. Size of available space = Container size - Total size of all child components. Value <strong id="b13294279468"><a name="b13294279468"></a><a name="b13294279468"></a>0</strong> indicates that the child component does not grow.</p>
<div class="note" id="note62462313719"><a name="note62462313719"></a><a name="note62462313719"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1324610312715"><a name="p1324610312715"></a><a name="p1324610312715"></a>This attribute takes effect only when the parent component is <strong id="b1949597674"><a name="b1949597674"></a><a name="b1949597674"></a>&lt;div&gt;</strong>, <strong id="b1228816217"><a name="b1228816217"></a><a name="b1228816217"></a>&lt;list-item&gt;</strong>, or <strong id="b184212334"><a name="b184212334"></a><a name="b184212334"></a>&lt;tabs&gt;</strong>.</p>
</div></div>
<p id="p14246435713"><a name="p14246435713"></a><a name="p14246435713"></a></p>
</td>
</tr>
<tr id="row187966501419"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="ac65ef7e2b1f24a13b09c495f643168c9"><a name="ac65ef7e2b1f24a13b09c495f643168c9"></a><a name="ac65ef7e2b1f24a13b09c495f643168c9"></a>flex-shrink</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="a98e7d367f0e649699892ae5bad6ade37"><a name="a98e7d367f0e649699892ae5bad6ade37"></a><a name="a98e7d367f0e649699892ae5bad6ade37"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="a422d978368814d12a33201cb839060ee"><a name="a422d978368814d12a33201cb839060ee"></a><a name="a422d978368814d12a33201cb839060ee"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p164884516713"><a name="p164884516713"></a><a name="p164884516713"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p13640114214710"><a name="p13640114214710"></a><a name="p13640114214710"></a>How much a child component will shrink. The shrink occurs only when the sum of default element widths is greater than that of the parent component. Value <strong id="b618802815466"><a name="b618802815466"></a><a name="b618802815466"></a>0</strong> indicates that the child component does not shrink.</p>
<div class="note" id="note364074212713"><a name="note364074212713"></a><a name="note364074212713"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p186406427711"><a name="p186406427711"></a><a name="p186406427711"></a>This attribute takes effect only when the parent component is <strong id="b97929801"><a name="b97929801"></a><a name="b97929801"></a>&lt;div&gt;</strong>, <strong id="b1772326374"><a name="b1772326374"></a><a name="b1772326374"></a>&lt;list-item&gt;</strong>, or <strong id="b397489204"><a name="b397489204"></a><a name="b397489204"></a>&lt;tabs&gt;</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row438316531843"><td class="cellrowborder" valign="top" width="18.209640397857694%" headers="mcps1.1.6.1.1 "><p id="a82c323a994634032963169eeee1a55e4"><a name="a82c323a994634032963169eeee1a55e4"></a><a name="a82c323a994634032963169eeee1a55e4"></a>flex-basis</p>
</td>
<td class="cellrowborder" valign="top" width="14.135424636572303%" headers="mcps1.1.6.1.2 "><p id="p1148910787"><a name="p1148910787"></a><a name="p1148910787"></a>&lt;length&gt;</p>
<p id="a43613cf0c2184c0d8b44e8d292f6edb7"><a name="a43613cf0c2184c0d8b44e8d292f6edb7"></a><a name="a43613cf0c2184c0d8b44e8d292f6edb7"></a></p>
</td>
<td class="cellrowborder" valign="top" width="22.083014537107886%" headers="mcps1.1.6.1.3 "><p id="ab9e1c7dc25f840e58993af05c1d32109"><a name="ab9e1c7dc25f840e58993af05c1d32109"></a><a name="ab9e1c7dc25f840e58993af05c1d32109"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.7999234889058915%" headers="mcps1.1.6.1.4 "><p id="p124162561774"><a name="p124162561774"></a><a name="p124162561774"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.77199693955624%" headers="mcps1.1.6.1.5 "><p id="p192811541574"><a name="p192811541574"></a><a name="p192811541574"></a>Initial length of a child component on the main axis</p>
<div class="note" id="note162817541279"><a name="note162817541279"></a><a name="note162817541279"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1928115418713"><a name="p1928115418713"></a><a name="p1928115418713"></a>This attribute takes effect only when the parent component is <strong id="b103138373466"><a name="b103138373466"></a><a name="b103138373466"></a>&lt;div&gt;</strong>, <strong id="b831417371468"><a name="b831417371468"></a><a name="b831417371468"></a>&lt;list-item&gt;</strong>, or <strong id="b13314153715462"><a name="b13314153715462"></a><a name="b13314153715462"></a>&lt;tabs&gt;</strong>.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1944813319536"></a>
Not supported Not supported
## Methods<a name="section163401342195315"></a>
## Methods
Not supported Not supported
## Example<a name="section230641814493"></a>
``` ## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<div class="content"> <div class="content">
...@@ -217,7 +69,7 @@ Not supported ...@@ -217,7 +69,7 @@ Not supported
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
margin: 20px; margin: 20px;
...@@ -242,5 +94,4 @@ Not supported ...@@ -242,5 +94,4 @@ Not supported
} }
``` ```
![](figures/1-1.jpg) ![1-1](figures/1-1.jpg)
# image-animator<a name="EN-US_TOPIC_0000001173324625"></a> # image-animator
The **<image-animator\>** component is used to provide an image frame animator. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Child Component<a name="section393521619565"></a> The **\<image-animator>** component is used to provide an image frame animator.
## Child Components
Not supported Not supported
## Attributes<a name="section1342212415618"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
<a name="table20633101642315"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row6678114174919"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p425710265496"><a name="p425710265496"></a><a name="p425710265496"></a>images</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1257142694916"><a name="p1257142694916"></a><a name="p1257142694916"></a>Array&lt;ImageFrame&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1725752654912"><a name="p1725752654912"></a><a name="p1725752654912"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1025752610497"><a name="p1025752610497"></a><a name="p1025752610497"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1225732612491"><a name="p1225732612491"></a><a name="p1225732612491"></a>Image frame information. The frame information includes the image path, size, and location. Currently, the following image formats are supported: PNG and JPG. For details about <strong id="b1451343442511"><a name="b1451343442511"></a><a name="b1451343442511"></a>ImageFrame</strong>, see <a href="#table67453165913">Table 1</a>.</p>
<div class="note" id="note1925732612497"><a name="note1925732612497"></a><a name="note1925732612497"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p3257226184915"><a name="p3257226184915"></a><a name="p3257226184915"></a>Set this attribute using data binding, for example, <strong id="b3644923191911"><a name="b3644923191911"></a><a name="b3644923191911"></a>images = {{images}}</strong>. Declare the corresponding variable <strong id="b3583125942516"><a name="b3583125942516"></a><a name="b3583125942516"></a>images: [{src: "/common/heart-rate01.png"}, {src: "/common/heart-rate02.png"}]</strong> in the JavaScript.</p>
<p id="p205711340134919"><a name="p205711340134919"></a><a name="p205711340134919"></a>Declare the variable <strong id="b152638162228"><a name="b152638162228"></a><a name="b152638162228"></a>images: [{src: "/common/heart-rate01.png", duration: "100"}, {src: "/common/heart-rate02.png", duration: "200"}]</strong> in the JavaScript. You can set the duration (in milliseconds) of each image frame. <sup id="sup1083881410267"><a name="sup1083881410267"></a><a name="sup1083881410267"></a>6+</sup></p>
</div></div>
</td>
</tr>
<tr id="row2926174817528"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1292784811523"><a name="p1292784811523"></a><a name="p1292784811523"></a>predecode<sup id="sup31371043122616"><a name="sup31371043122616"></a><a name="sup31371043122616"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p292713488521"><a name="p292713488521"></a><a name="p292713488521"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9927134812527"><a name="p9927134812527"></a><a name="p9927134812527"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p14927134818521"><a name="p14927134818521"></a><a name="p14927134818521"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p792704825216"><a name="p792704825216"></a><a name="p792704825216"></a>Whether to enable pre-decoding. The default value is 0, indicating that pre-decoding is disabled. If this parameter is set to 2, the last two images are loaded to the cache in advance to improve the performance when the current page is played.</p>
</td>
</tr>
<tr id="row739819164910"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p16257626134912"><a name="p16257626134912"></a><a name="p16257626134912"></a>iteration</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p18257112611492"><a name="p18257112611492"></a><a name="p18257112611492"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p22571126184915"><a name="p22571126184915"></a><a name="p22571126184915"></a>infinite</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p14257202694917"><a name="p14257202694917"></a><a name="p14257202694917"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p22571326114916"><a name="p22571326114916"></a><a name="p22571326114916"></a>Number of times that the frame animation is played. <strong id="b20158158192210"><a name="b20158158192210"></a><a name="b20158158192210"></a>number</strong> indicates a fixed number of playback operations, and <strong id="b1272110157230"><a name="b1272110157230"></a><a name="b1272110157230"></a>infinite</strong> indicates an unlimited number of playback operations.</p>
</td>
</tr>
<tr id="row163991791492"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p12576265493"><a name="p12576265493"></a><a name="p12576265493"></a>reverse</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p15257826194918"><a name="p15257826194918"></a><a name="p15257826194918"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p122573263499"><a name="p122573263499"></a><a name="p122573263499"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p12571626134910"><a name="p12571626134910"></a><a name="p12571626134910"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p925816262499"><a name="p925816262499"></a><a name="p925816262499"></a>Playback sequence. The value <strong id="b67459152416"><a name="b67459152416"></a><a name="b67459152416"></a>false</strong> indicates that images are played from the first one to the last one, and <strong id="b175171216307"><a name="b175171216307"></a><a name="b175171216307"></a>true</strong> indicates that images are played from the last one to the first one.</p>
</td>
</tr>
<tr id="row320318310493"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p425862611491"><a name="p425862611491"></a><a name="p425862611491"></a>fixedsize</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3258182604914"><a name="p3258182604914"></a><a name="p3258182604914"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1425852684910"><a name="p1425852684910"></a><a name="p1425852684910"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p625862612497"><a name="p625862612497"></a><a name="p625862612497"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p7258626174910"><a name="p7258626174910"></a><a name="p7258626174910"></a>Whether the image size is fixed to the widget size. <strong id="b919917296321"><a name="b919917296321"></a><a name="b919917296321"></a>true</strong>: The image size is the same as the widget size. In this case, the width, height, top, and left attributes of the image are invalid. <strong id="b89251240113218"><a name="b89251240113218"></a><a name="b89251240113218"></a>false</strong>: The width, height, top, and left attributes of each image must be set separately.</p>
</td>
</tr>
<tr id="row168157599487"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p15258152613494"><a name="p15258152613494"></a><a name="p15258152613494"></a>duration</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p8258102610496"><a name="p8258102610496"></a><a name="p8258102610496"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9258112654910"><a name="p9258112654910"></a><a name="p9258112654910"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1225814262495"><a name="p1225814262495"></a><a name="p1225814262495"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p9258102684910"><a name="p9258102684910"></a><a name="p9258102684910"></a>Single video playback duration. The unit can be s (standing for seconds) or ms. The default unit is ms. If the value is <strong id="b165541819123316"><a name="b165541819123316"></a><a name="b165541819123316"></a>0</strong>, no image is played. The value change takes effect only at the start of the next cycle. If image-specific durations have been set, the settings of this attribute do not take effect.</p>
</td>
</tr>
<tr id="row15460155375910"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p204611353105915"><a name="p204611353105915"></a><a name="p204611353105915"></a>fillmode<sup id="sup4224194014312"><a name="sup4224194014312"></a><a name="sup4224194014312"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1461125318597"><a name="p1461125318597"></a><a name="p1461125318597"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p11461155311592"><a name="p11461155311592"></a><a name="p11461155311592"></a>forwards</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p3461135316592"><a name="p3461135316592"></a><a name="p3461135316592"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p48661353174"><a name="p48661353174"></a><a name="p48661353174"></a>Status of the frame animation after its playback is complete. Available values are as follows:</p>
<a name="ul183656592213"></a><a name="ul183656592213"></a><ul id="ul183656592213"><li><strong id="b4108122744120"><a name="b4108122744120"></a><a name="b4108122744120"></a>none</strong>: Restores to the initial status.</li><li><strong id="b8540732144117"><a name="b8540732144117"></a><a name="b8540732144117"></a>forwards</strong>: Retains the ending status defined for the last key frame.</li></ul>
</td>
</tr>
</tbody>
</table>
**Table 1** ImageFrame description | Name | Type | Default Value | Mandatory | Description |
| ---------------------- | -------------------------- | -------- | ---- | ---------------------------------------- |
| images | Array&lt;ImageFrame&gt; | - | Yes | Image frame information. The frame information includes the image path, size, and location. The supported image formats include PNG and JPG. <br>Set this attribute using data binding.<br>- Reference image resources in the HML file: **images = {{images}}**.<br>- Declare the corresponding variables in the JS file:<br>**images: [{src: "/common/heart-rate01.png",duration:"100"}]** Since API version 6,the duration (in milliseconds) per image frame can be set.|
| predecode<sup>6+</sup> | number | 0 | No | Whether to enable pre-decoding. The default value **0** indicates that pre-decoding is disabled. The value **2** indicates that two images following the currently playing frame will be cached in advance to improve performance.|
| iteration | number \| string | infinite | No | Number of times that the frame animation is played. **number** indicates a fixed number of playback operations, and **infinite** indicates an unlimited number of playback operations.|
| reverse | boolean | false | No | Playback sequence. The value **false** indicates that images are played from the first one to the last one, and **true** indicates that images are played from the last one to the first one.|
| fixedsize | boolean | true | No | Whether the image size is the same as the component size.<br> **true**: The image size is the same as the component size. In this case, the width, height, top, and left attributes of the image are invalid. **false**: The width, height, top, and left attributes of each image must be set separately.|
| duration | string | - | Yes | Single video playback duration. The unit can be s (standing for seconds) or ms. The default unit is ms. If the value is **0**, no image is played. The value change takes effect only at the start of the next cycle. If image-specific durations have been set, the settings of this attribute do not take effect. |
| fillmode<sup>5+</sup> | string | forwards | No | Status of the frame animation after its playback is complete. Available values are as follows:<br>- **none**: Restores to the initial status.<br>- **forwards**: Retains the ending status defined for the last key frame.|
<a name="table67453165913"></a> **Table 1** ImageFrame
<table><thead align="left"><tr id="row127451816696"><th class="cellrowborder" valign="top" width="11.330000000000002%" id="mcps1.2.6.1.1"><p id="p20745516799"><a name="p20745516799"></a><a name="p20745516799"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="9.860000000000001%" id="mcps1.2.6.1.2"><p id="p6745181616919"><a name="p6745181616919"></a><a name="p6745181616919"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.810000000000002%" id="mcps1.2.6.1.3"><p id="p27452161915"><a name="p27452161915"></a><a name="p27452161915"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="10.000000000000002%" id="mcps1.2.6.1.4"><p id="p187461164918"><a name="p187461164918"></a><a name="p187461164918"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="58.00000000000001%" id="mcps1.2.6.1.5"><p id="p174651611917"><a name="p174651611917"></a><a name="p174651611917"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row974611615915"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p27461616392"><a name="p27461616392"></a><a name="p27461616392"></a>src</p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p1874612161194"><a name="p1874612161194"></a><a name="p1874612161194"></a>&lt;uri&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p167462161197"><a name="p167462161197"></a><a name="p167462161197"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p674612161914"><a name="p674612161914"></a><a name="p674612161914"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p87460161592"><a name="p87460161592"></a><a name="p87460161592"></a>Image path.<span id="ph5230045184011"><a name="ph5230045184011"></a><a name="ph5230045184011"></a> The image format can be SVG, PNG, or JPG.</span></p>
</td>
</tr>
<tr id="row1574611161790"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p1674621619911"><a name="p1674621619911"></a><a name="p1674621619911"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p4746516691"><a name="p4746516691"></a><a name="p4746516691"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p1874661618915"><a name="p1874661618915"></a><a name="p1874661618915"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p13746161615914"><a name="p13746161615914"></a><a name="p13746161615914"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p57461162915"><a name="p57461162915"></a><a name="p57461162915"></a>Image width</p>
</td>
</tr>
<tr id="row1746131615914"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p137467160910"><a name="p137467160910"></a><a name="p137467160910"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p12285145181014"><a name="p12285145181014"></a><a name="p12285145181014"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p3285144571012"><a name="p3285144571012"></a><a name="p3285144571012"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p728514520106"><a name="p728514520106"></a><a name="p728514520106"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p1174619161998"><a name="p1174619161998"></a><a name="p1174619161998"></a>Image height</p>
</td>
</tr>
<tr id="row157461216990"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p157461916297"><a name="p157461916297"></a><a name="p157461916297"></a>top</p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p172301247131019"><a name="p172301247131019"></a><a name="p172301247131019"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p152301647141015"><a name="p152301647141015"></a><a name="p152301647141015"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p15230164731016"><a name="p15230164731016"></a><a name="p15230164731016"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p11863511151119"><a name="p11863511151119"></a><a name="p11863511151119"></a>Vertical coordinate of the image relative to the upper left corner of the widget</p>
</td>
</tr>
<tr id="row107477161396"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p57474161995"><a name="p57474161995"></a><a name="p57474161995"></a>left</p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p317644961019"><a name="p317644961019"></a><a name="p317644961019"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p19176154951014"><a name="p19176154951014"></a><a name="p19176154951014"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p1176049201020"><a name="p1176049201020"></a><a name="p1176049201020"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p191151321151111"><a name="p191151321151111"></a><a name="p191151321151111"></a>Horizontal coordinate of the image relative to the upper left corner of the widget</p>
</td>
</tr>
<tr id="row243510340595"><td class="cellrowborder" valign="top" width="11.330000000000002%" headers="mcps1.2.6.1.1 "><p id="p1643633417593"><a name="p1643633417593"></a><a name="p1643633417593"></a>duration<sup id="sup10707409460"><a name="sup10707409460"></a><a name="sup10707409460"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="9.860000000000001%" headers="mcps1.2.6.1.2 "><p id="p1643620340595"><a name="p1643620340595"></a><a name="p1643620340595"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.810000000000002%" headers="mcps1.2.6.1.3 "><p id="p14436133455910"><a name="p14436133455910"></a><a name="p14436133455910"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="10.000000000000002%" headers="mcps1.2.6.1.4 "><p id="p5436134145916"><a name="p5436134145916"></a><a name="p5436134145916"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.00000000000001%" headers="mcps1.2.6.1.5 "><p id="p743613347596"><a name="p743613347596"></a><a name="p743613347596"></a>Playback duration of each image frame, in milliseconds.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section1774719169253"></a> | Name | Type | Default Value | Mandatory | Description |
| --------------------- | -------------- | ---- | ---- | ---------------------- |
| src | &lt;uri&gt; | - | Yes | Image path. The image format can be SVG, PNG, or JPG.|
| width | &lt;length&gt; | 0 | No | Image width. |
| height | &lt;length&gt; | 0 | No | Image height. |
| top | &lt;length&gt; | 0 | No | Vertical coordinate of the image relative to the upper left corner of the component. |
| left | &lt;length&gt; | 0 | No | Horizontal coordinate of the image relative to the upper left corner of the component. |
| duration<sup>6+</sup> | number | - | No | Playback duration of each image frame, in milliseconds. |
Styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section17969351566"></a> ## Styles
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row287217513517"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p2602207165111"><a name="p2602207165111"></a><a name="p2602207165111"></a>start</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p19602157185119"><a name="p19602157185119"></a><a name="p19602157185119"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p146021079518"><a name="p146021079518"></a><a name="p146021079518"></a>Triggered when the frame animation starts</p>
</td>
</tr>
<tr id="row0878102155118"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p1760237135118"><a name="p1760237135118"></a><a name="p1760237135118"></a>pause</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p160214745113"><a name="p160214745113"></a><a name="p160214745113"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p26027715112"><a name="p26027715112"></a><a name="p26027715112"></a>Triggered when the frame animation pauses</p>
</td>
</tr>
<tr id="row151519594509"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p86027735118"><a name="p86027735118"></a><a name="p86027735118"></a>stop</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p196024715513"><a name="p196024715513"></a><a name="p196024715513"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p760216735110"><a name="p760216735110"></a><a name="p760216735110"></a>Triggered when the frame animation stops</p>
</td>
</tr>
<tr id="row189025517507"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p4602147175120"><a name="p4602147175120"></a><a name="p4602147175120"></a>resume </p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p12602137155110"><a name="p12602137155110"></a><a name="p12602137155110"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p160267105114"><a name="p160267105114"></a><a name="p160267105114"></a>Triggered when the frame animation resumes</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section1428810433566"></a> ## Events
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported. In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
<a name="ta27ae6832ab647a880ab27801368ec17"></a> | Name | Parameter | Description |
<table><thead align="left"><tr id="r00746cc3f4244fd7bf405d1640b42842"><th class="cellrowborder" valign="top" width="10.89%" id="mcps1.1.4.1.1"><p id="a6853bf471a534d9185a46033e5301a3c"><a name="a6853bf471a534d9185a46033e5301a3c"></a><a name="a6853bf471a534d9185a46033e5301a3c"></a>Name</p> | ------ | ---- | --------- |
</th> | start | - | Triggered when the frame animation starts.|
<th class="cellrowborder" valign="top" width="10.9%" id="mcps1.1.4.1.2"><p id="a2f6b46265ccd412b8be977c934e2e06e"><a name="a2f6b46265ccd412b8be977c934e2e06e"></a><a name="a2f6b46265ccd412b8be977c934e2e06e"></a>Parameter</p> | pause | - | Triggered when the frame animation pauses.|
</th> | stop | - | Triggered when the frame animation stops.|
<th class="cellrowborder" valign="top" width="78.21000000000001%" id="mcps1.1.4.1.3"><p id="ab97e815e4f734c4290f4f7cb608e45d4"><a name="ab97e815e4f734c4290f4f7cb608e45d4"></a><a name="ab97e815e4f734c4290f4f7cb608e45d4"></a>Description</p> | resume | - | Triggered when the frame animation resumes.|
</th>
</tr>
</thead>
<tbody><tr id="rfd984b5dab4c419fb56fb95b53614076"><td class="cellrowborder" valign="top" width="10.89%" headers="mcps1.1.4.1.1 "><p id="a650170fd03b64d42894295d360ad74dd"><a name="a650170fd03b64d42894295d360ad74dd"></a><a name="a650170fd03b64d42894295d360ad74dd"></a>start</p>
</td>
<td class="cellrowborder" valign="top" width="10.9%" headers="mcps1.1.4.1.2 "><p id="a634a82d9b27a449891db2c1e04622259"><a name="a634a82d9b27a449891db2c1e04622259"></a><a name="a634a82d9b27a449891db2c1e04622259"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="78.21000000000001%" headers="mcps1.1.4.1.3 "><p id="a8ab976e5b8344f9b9849843a5b30128a"><a name="a8ab976e5b8344f9b9849843a5b30128a"></a><a name="a8ab976e5b8344f9b9849843a5b30128a"></a>Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame.</p>
</td>
</tr>
<tr id="r15b7a1086fd047ea984b9cb4955dd98c"><td class="cellrowborder" valign="top" width="10.89%" headers="mcps1.1.4.1.1 "><p id="aab35a49bf5d440958734b6b30ae5c129"><a name="aab35a49bf5d440958734b6b30ae5c129"></a><a name="aab35a49bf5d440958734b6b30ae5c129"></a>pause</p>
</td>
<td class="cellrowborder" valign="top" width="10.9%" headers="mcps1.1.4.1.2 "><p id="aaf270b3435ba4d1ba5c038066d3d08a8"><a name="aaf270b3435ba4d1ba5c038066d3d08a8"></a><a name="aaf270b3435ba4d1ba5c038066d3d08a8"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="78.21000000000001%" headers="mcps1.1.4.1.3 "><p id="a4ea339c3428f474696fe3491579ac922"><a name="a4ea339c3428f474696fe3491579ac922"></a><a name="a4ea339c3428f474696fe3491579ac922"></a>Pauses the frame animation playback of an image.</p>
</td>
</tr>
<tr id="row2389173613484"><td class="cellrowborder" valign="top" width="10.89%" headers="mcps1.1.4.1.1 "><p id="p183906365481"><a name="p183906365481"></a><a name="p183906365481"></a>stop</p>
</td>
<td class="cellrowborder" valign="top" width="10.9%" headers="mcps1.1.4.1.2 "><p id="p18390193624812"><a name="p18390193624812"></a><a name="p18390193624812"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="78.21000000000001%" headers="mcps1.1.4.1.3 "><p id="p18390136184810"><a name="p18390136184810"></a><a name="p18390136184810"></a>Stops the frame animation playback of an image.</p>
</td>
</tr>
<tr id="row2051494718486"><td class="cellrowborder" valign="top" width="10.89%" headers="mcps1.1.4.1.1 "><p id="p16514124764810"><a name="p16514124764810"></a><a name="p16514124764810"></a>resume</p>
</td>
<td class="cellrowborder" valign="top" width="10.9%" headers="mcps1.1.4.1.2 "><p id="p16515144764811"><a name="p16515144764811"></a><a name="p16515144764811"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="78.21000000000001%" headers="mcps1.1.4.1.3 "><p id="p18515847164812"><a name="p18515847164812"></a><a name="p18515847164812"></a>Resumes the frame animation playback of an image.</p>
</td>
</tr>
<tr id="row16356183618265"><td class="cellrowborder" valign="top" width="10.89%" headers="mcps1.1.4.1.1 "><p id="p53572364269"><a name="p53572364269"></a><a name="p53572364269"></a>getState</p>
</td>
<td class="cellrowborder" valign="top" width="10.9%" headers="mcps1.1.4.1.2 "><p id="p835743613261"><a name="p835743613261"></a><a name="p835743613261"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="78.21000000000001%" headers="mcps1.1.4.1.3 "><p id="p5357183632618"><a name="p5357183632618"></a><a name="p5357183632618"></a>Obtains the playback state. Available values are as follows:</p>
<a name="ul1465819221205"></a><a name="ul1465819221205"></a><ul id="ul1465819221205"><li>Playing</li><li>Paused</li><li>Stopped</li></ul>
</td>
</tr>
</tbody>
</table>
## Example Code<a name="section118221913375"></a>
``` ## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name | Parameter | Description |
| -------- | ---- | ---------------------------------------- |
| start | - | Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. |
| pause | - | Pauses the frame animation playback of an image. |
| stop | - | Stops the frame animation playback of an image. |
| resume | - | Resumes the frame animation playback of an image. |
| getState | - | Obtains the playback state. Available values are as follows:<br>- playing<br>- paused<br>- stopped|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<image-animator class="animator" ref="animator" images="{{frames}}" duration="1s" /> <image-animator class="animator" ref="animator" images="{{frames}}" duration="1s" />
...@@ -306,7 +83,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods. ...@@ -306,7 +83,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -335,7 +112,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods. ...@@ -335,7 +112,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods.
} }
``` ```
``` ```js
//xxx.js //xxx.js
export default { export default {
data: { data: {
...@@ -414,5 +191,4 @@ export default { ...@@ -414,5 +191,4 @@ export default {
}; };
``` ```
![](figures/image-animator.gif) ![image-animator](figures/image-animator.gif)
# image<a name="EN-US_TOPIC_0000001173164699"></a> # image
The **<image\>** component is used to render and display images. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Child Component<a name="section9288143101012"></a> The **\<image>** component is used to render and display images.
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row10711153415392"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p13851942163912"><a name="p13851942163912"></a><a name="p13851942163912"></a>src</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p53851422390"><a name="p53851422390"></a><a name="p53851422390"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p193856420395"><a name="p193856420395"></a><a name="p193856420395"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p23851942103915"><a name="p23851942103915"></a><a name="p23851942103915"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p4386542163913"><a name="p4386542163913"></a><a name="p4386542163913"></a><span id="ph1386114233917"><a name="ph1386114233917"></a><a name="ph1386114233917"></a>Image path, which supports local paths. The supported image formats include PNG, JPG, BMP, SVG, and GIF.</span></p>
<p id="p2020265093811"><a name="p2020265093811"></a><a name="p2020265093811"></a>Base64 string<sup id="sup792414482411"><a name="sup792414482411"></a><a name="sup792414482411"></a>6+</sup> is supported. The format is data:image/[png | jpeg | bmp | webp];base64, [base64 data],, where [base64 data] is a Base64 string.</p>
<p id="p158689315419"><a name="p158689315419"></a><a name="p158689315419"></a>The path prefix of <strong id="b48648261193"><a name="b48648261193"></a><a name="b48648261193"></a>dataability://</strong> is supported, which allows access to the image path provided by the Data ability.</p>
</td>
</tr>
<tr id="row871123253917"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p11386134218396"><a name="p11386134218396"></a><a name="p11386134218396"></a>alt</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p338613422396"><a name="p338613422396"></a><a name="p338613422396"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9386142203914"><a name="p9386142203914"></a><a name="p9386142203914"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p18386124213913"><a name="p18386124213913"></a><a name="p18386124213913"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p8386194283917"><a name="p8386194283917"></a><a name="p8386194283917"></a>Placeholder image displayed during image loading.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section45171131134215"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following style attributes are supported.
<a name="table3635337165618"></a>
<table><thead align="left"><tr id="row163523745618"><th class="cellrowborder" valign="top" width="23.16768323167683%" id="mcps1.1.6.1.1"><p id="p763583711569"><a name="p763583711569"></a><a name="p763583711569"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.427957204279572%" id="mcps1.1.6.1.2"><p id="p76351837135618"><a name="p76351837135618"></a><a name="p76351837135618"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p1963543714562"><a name="p1963543714562"></a><a name="p1963543714562"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p163513712567"><a name="p163513712567"></a><a name="p163513712567"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p16635113735617"><a name="p16635113735617"></a><a name="p16635113735617"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row13635143745613"><td class="cellrowborder" valign="top" width="23.16768323167683%" headers="mcps1.1.6.1.1 "><p id="p063616375563"><a name="p063616375563"></a><a name="p063616375563"></a>object-fit</p>
</td>
<td class="cellrowborder" valign="top" width="20.427957204279572%" headers="mcps1.1.6.1.2 "><p id="p563673711568"><a name="p563673711568"></a><a name="p563673711568"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1763616378564"><a name="p1763616378564"></a><a name="p1763616378564"></a>cover</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1636537105617"><a name="p1636537105617"></a><a name="p1636537105617"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p186361237165612"><a name="p186361237165612"></a><a name="p186361237165612"></a>Image scale type. For details about available values, see <a href="#table175851535113711">Types of the object-fit style</a>. The SVG format is not supported.</p>
</td>
</tr>
<tr id="row10636173719564"><td class="cellrowborder" valign="top" width="23.16768323167683%" headers="mcps1.1.6.1.1 "><p id="p26361237195610"><a name="p26361237195610"></a><a name="p26361237195610"></a>match-text-direction</p>
</td>
<td class="cellrowborder" valign="top" width="20.427957204279572%" headers="mcps1.1.6.1.2 "><p id="p563653795612"><a name="p563653795612"></a><a name="p563653795612"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1636193725615"><a name="p1636193725615"></a><a name="p1636193725615"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p10636203725617"><a name="p10636203725617"></a><a name="p10636203725617"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p176361037175612"><a name="p176361037175612"></a><a name="p176361037175612"></a>Whether image orientation changes with the text direction. The SVG format is not supported.</p>
</td>
</tr>
<tr id="row17636037135618"><td class="cellrowborder" valign="top" width="23.16768323167683%" headers="mcps1.1.6.1.1 "><p id="p763614376564"><a name="p763614376564"></a><a name="p763614376564"></a>fit-original-size</p>
</td>
<td class="cellrowborder" valign="top" width="20.427957204279572%" headers="mcps1.1.6.1.2 "><p id="p18636103795617"><a name="p18636103795617"></a><a name="p18636103795617"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p14636143719565"><a name="p14636143719565"></a><a name="p14636143719565"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p196362371564"><a name="p196362371564"></a><a name="p196362371564"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p166364377563"><a name="p166364377563"></a><a name="p166364377563"></a>Whether the <strong id="b130129182317"><a name="b130129182317"></a><a name="b130129182317"></a>&lt;image&gt;</strong> component adapts to the image source size when the width and height are not set. If this attribute is set to <strong id="b93812952317"><a name="b93812952317"></a><a name="b93812952317"></a>true</strong>, the <strong id="b14391910238"><a name="b14391910238"></a><a name="b14391910238"></a>object-fit</strong> attribute does not take effect. SVG images do not support this attribute.</p>
</td>
</tr>
<tr id="row12824651173817"><td class="cellrowborder" valign="top" width="23.16768323167683%" headers="mcps1.1.6.1.1 "><p id="p782418514382"><a name="p782418514382"></a><a name="p782418514382"></a>object-position<sup id="sup2034121882110"><a name="sup2034121882110"></a><a name="sup2034121882110"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.427957204279572%" headers="mcps1.1.6.1.2 "><p id="p15824185112385"><a name="p15824185112385"></a><a name="p15824185112385"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p178241651103815"><a name="p178241651103815"></a><a name="p178241651103815"></a>0px 0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p8824165110385"><a name="p8824165110385"></a><a name="p8824165110385"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1582420513383"><a name="p1582420513383"></a><a name="p1582420513383"></a>Position of an image in the component.</p>
<p id="p8751515174019"><a name="p8751515174019"></a><a name="p8751515174019"></a>There are two setting types:</p>
<p id="p19751111518408"><a name="p19751111518408"></a><a name="p19751111518408"></a>1. Pixels. For example, <strong id="b556573313565"><a name="b556573313565"></a><a name="b556573313565"></a>15px 15px</strong> indicates the moving position along the x-axis or y-axis.</p>
<p id="p119413158218"><a name="p119413158218"></a><a name="p119413158218"></a>2. Characters. Optional values are as follows:</p>
<a name="ul1815918338215"></a><a name="ul1815918338215"></a><ul id="ul1815918338215"><li><strong id="b3821337205612"><a name="b3821337205612"></a><a name="b3821337205612"></a>left</strong>: The image is displayed on the left of the component.</li><li><strong id="b15293940115610"><a name="b15293940115610"></a><a name="b15293940115610"></a>top</strong> The image is displayed on the top of the component.</li><li><strong id="b7691642165610"><a name="b7691642165610"></a><a name="b7691642165610"></a>right</strong> The image is displayed on the right of the component.</li><li><strong id="b1347220437562"><a name="b1347220437562"></a><a name="b1347220437562"></a>bottom</strong> The image is displayed at the bottom of the component.</li></ul>
</td>
</tr>
</tbody>
</table>
**Table 1** Types of the object-fit style
<a name="table175851535113711"></a>
<table><thead align="left"><tr id="row9585183516376"><th class="cellrowborder" valign="top" width="15.02%" id="mcps1.2.3.1.1"><p id="p25851835163714"><a name="p25851835163714"></a><a name="p25851835163714"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="84.98%" id="mcps1.2.3.1.2"><p id="p1058583583717"><a name="p1058583583717"></a><a name="p1058583583717"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row658523520377"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.3.1.1 "><p id="p1558553553710"><a name="p1558553553710"></a><a name="p1558553553710"></a>cover</p>
</td>
<td class="cellrowborder" valign="top" width="84.98%" headers="mcps1.2.3.1.2 "><p id="p4585103573718"><a name="p4585103573718"></a><a name="p4585103573718"></a>The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries and displayed in the middle.</p>
</td>
</tr>
<tr id="row8585133543716"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.3.1.1 "><p id="p20585735123718"><a name="p20585735123718"></a><a name="p20585735123718"></a>contain</p>
</td>
<td class="cellrowborder" valign="top" width="84.98%" headers="mcps1.2.3.1.2 "><p id="p5585153523711"><a name="p5585153523711"></a><a name="p5585153523711"></a>The image is scaled with the aspect ratio retained for the image to be completely displayed within the display boundaries and displayed in the middle.</p>
</td>
</tr>
<tr id="row1758511351377"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.3.1.1 "><p id="p11586163511379"><a name="p11586163511379"></a><a name="p11586163511379"></a>fill</p>
</td>
<td class="cellrowborder" valign="top" width="84.98%" headers="mcps1.2.3.1.2 "><p id="p958611356373"><a name="p958611356373"></a><a name="p958611356373"></a>The image is resized to fill the display area and its aspect ratio is not retained.</p>
</td>
</tr>
<tr id="row15586143520371"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.3.1.1 "><p id="p195866353376"><a name="p195866353376"></a><a name="p195866353376"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="84.98%" headers="mcps1.2.3.1.2 "><p id="p2586735113716"><a name="p2586735113716"></a><a name="p2586735113716"></a>The image is displayed in the middle with its aspect ratio and size retained.</p>
</td>
</tr>
<tr id="row165861035133718"><td class="cellrowborder" valign="top" width="15.02%" headers="mcps1.2.3.1.1 "><p id="p195861435173720"><a name="p195861435173720"></a><a name="p195861435173720"></a>scale-down</p>
</td>
<td class="cellrowborder" valign="top" width="84.98%" headers="mcps1.2.3.1.2 "><p id="p5586835173713"><a name="p5586835173713"></a><a name="p5586835173713"></a>The image is displayed in the middle with its aspect ratio retained. The size is equal to or smaller than the original size.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>When using an SVG image, note that:
>- The SVG image will not be drawn if the length or width of the **<image\>** component is infinity.
>- If the image length and width are not specified in the SVG description, the SVG fills the **<image\>** component area.
>- If the image length and width are specified in the SVG description, the following rules are adopted to decide the final display effect:
>1. If the **<image\>** component is too small to afford the SVG image, the SVG image is cropped and only its upper left part is displayed in the component.
>2. If the **<image\>** component is big enough to afford the SVG image, this SVG image is displayed in the upper left corner of the component.
## Events<a name="section3892191911214"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table341925115454"></a>
<table><thead align="left"><tr id="row94208515453"><th class="cellrowborder" valign="top" width="24.91249124912491%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.492949294929495%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row370317364612"><td class="cellrowborder" valign="top" width="24.91249124912491%" headers="mcps1.1.4.1.1 "><p id="p1177515914469"><a name="p1177515914469"></a><a name="p1177515914469"></a>complete(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="29.492949294929495%" headers="mcps1.1.4.1.2 "><p id="p4775139144612"><a name="p4775139144612"></a><a name="p4775139144612"></a>{ width: width, height: height }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1577514934614"><a name="p1577514934614"></a><a name="p1577514934614"></a>Triggered when an image is successfully loaded. The loaded image is returned.</p>
</td>
</tr>
<tr id="row8120201134610"><td class="cellrowborder" valign="top" width="24.91249124912491%" headers="mcps1.1.4.1.1 "><p id="p8775992468"><a name="p8775992468"></a><a name="p8775992468"></a>error(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="29.492949294929495%" headers="mcps1.1.4.1.2 "><p id="p107755934612"><a name="p107755934612"></a><a name="p107755934612"></a>{ width: width, height: height }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p277510954617"><a name="p277510954617"></a><a name="p277510954617"></a>Triggered when an exception occurs during image loading. In this case, the width and height are <strong id="b3579103124317"><a name="b3579103124317"></a><a name="b3579103124317"></a>0</strong>.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example Code<a name="section321147145519"></a>
``` ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| src | string | - | No | Image path, which supports local paths. The supported image formats include PNG, JPG, BMP, SVG, and GIF.<br>- The Base64 string<sup>6+</sup> is supported in the following format: data:image/[png \| jpeg \| bmp \| webp];base64, [base64 data], where **[base64 data]** is a Base64 string.<br>- The path prefix of **dataability://** is supported, which allows access to the image path provided by the Data ability.<sup>6+</sup>|
| alt | string | - | No | Alternative information for the image, which is displayed during image loading. |
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ---------------------------- | ------- | ------------ | ---- | ---------------------------------------- |
| object-fit | string | cover | No | Image scale type. This style is not supported for SVG images. For details about available values, see **object-fit**.|
| match-text-direction | boolean | false | No | Whether image orientation changes with the text direction. This style is not supported for SVG images. |
| fit-original-size | boolean | false | No | Whether the **\<image>** component adapts to the image source size when its width and height are not set. If this style is set to **true**, **object-fit** will not take effect. This style is not supported for SVG images.|
| object-position<sup>7+</sup> | string | 0px 0px | No | Position of an image in the component.<br>The options are as follows:<br>1. Pixels. For example, **15px 15px** indicates the moving position along the x-axis or y-axis.<br>2. Characters. Optional values are as follows:<br>- **left**: The image is displayed on the left of the component.<br>- **top** The image is displayed on the top of the component.<br>- **right** The image is displayed on the right of the component.<br>- **bottom** The image is displayed at the bottom of the component.|
**Table 1** object-fit
| Type | Description |
| ---------- | ------------------------------------ |
| cover | The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries and displayed in the middle.|
| contain | The image is scaled with the aspect ratio retained for the image to be completely displayed within the display boundaries and displayed in the middle. |
| fill | The image is scaled to fill the display area, and its aspect ratio is not retained. |
| none | The image is displayed in the middle with its aspect ratio and size retained. |
| scale-down | The image is displayed in the middle with its aspect ratio retained. The size is equal to or smaller than the original size. |
> **NOTE**
>
> When using an SVG image, note that:
>
> - The SVG image will not be drawn if the length or width of the **\<image>** component is infinity.
>
> - If the image length and width are not specified in the SVG description, the SVG image fills the **\<image>** component area.
>
> - If the image length and width are specified in the SVG description, the following rules are adopted to decide the final display effect:
>
> 1. If the **\<image>** component is too small to afford the SVG image, the SVG image is cropped and only its upper left part is displayed in the component.
>
> 2. If the **\<image>** component is big enough to afford the SVG image, this SVG image is displayed in the upper left corner of the component.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
| -------------- | ---------------------------------------- | ------------------------- |
| complete(Rich) | {<br> width: width,<br> height: height<br> } | Triggered when an image is successfully loaded. The loaded image size is returned.|
| error(Rich) | {<br> width: width,<br> height: height<br> } | Triggered when an exception occurs during image loading. In this case, the width and height are **0**. |
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<image src="common/images/example.png" style="width: 300px; height: 300px; object-fit:{{fit}}; object-position: center center; border: 1px solid red; "> <image src="common/images/example.png" style="width: 300px; height: 300px; object-fit:{{fit}}; object-position: center center; border: 1px solid red;">
</image> </image>
<select class="selects" onchange="change_fit"> <select class="selects" onchange="change_fit"><option for="{{fits}}" value="{{$item}}">{{$item}}</option></select>
<option for="{{fits}}" value="{{$item}}">{{$item}}</option>
</select>
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
.selects{ .selects{
margin-top: 20px; margin-top: 20px;
...@@ -227,7 +98,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -227,7 +98,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -240,5 +111,4 @@ export default { ...@@ -240,5 +111,4 @@ export default {
} }
``` ```
![](figures/example.gif) ![example](figures/example.gif)
# label<a name="EN-US_TOPIC_0000001127284880"></a> # label
The **<label\>** component defines labels for the **<input\>**, **<button\>**, and **<textarea\>** components. When a label is clicked, the click effect of the component associated with the label will be triggered. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<label>** component defines labels for the **\<input>**, **\<button>**, and **\<textarea>** components. When a label is clicked, the click effect of the component associated with the label will be triggered.
## Required Permissions
None None
## Child Component<a name="s0cb8fdf50d8a4f78a86bb76deec468fc"></a>
## Child Components
Not supported Not supported
## Attributes<a name="s6c8b111b1d2e40b3b356f03389dad9cf"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------ | ------ | ---- | ---- | ----------- |
| target | string | - | No | Attribute ID of the target component.|
<a name="table20633101642315"></a> ## Styles
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row113619414438"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1740035114313"><a name="p1740035114313"></a><a name="p1740035114313"></a>target</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1640018514431"><a name="p1640018514431"></a><a name="p1640018514431"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p15400354439"><a name="p15400354439"></a><a name="p15400354439"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p2040015534315"><a name="p2040015534315"></a><a name="p2040015534315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p140018514433"><a name="p140018514433"></a><a name="p140018514433"></a>Attribute ID of the target component.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="s5ed16ca4a52b4f8eb4c1a1e04ea9c2c4"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. | Name | Type | Default Value | Mandatory | Description |
| ----------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | #e5000000 | No | Font color. |
| font-size | &lt;length&gt; | 30px | No | Font size. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>For details about how to make the configuration take effect dynamically, see the **config-changes** attribute in the **config.json** file.|
| letter-spacing | &lt;length&gt; | 0px | No | Character spacing (px). |
| font-style | string | normal | No | Font style. Available values are as follows:<br>- **normal**: standard font style<br>- **italic**: italic font style|
| font-weight | number \| string | normal | No | Font width. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a larger font width.<br>The value of the number type must be an integer multiple of 100.<br>The value of the string type can be **lighter**, **normal**, **bold**, or **bolder**.|
| text-decoration | string | none | No | Text decoration. Available values are as follows:<br>- **underline**: An underline is used.<br>- **line-through**: A strikethrough is used.<br>- **none**: The standard text is used.|
| text-align | string | start<br>| No | Text alignment mode. Available values are as follows:<br>- **left**: The text is left-aligned.<br>- **center**: The text is center-aligned.<br>- **right**: The text is right-aligned.<br>- **start**: The text is aligned with the direction in which the text is written.<br>- **end**: The text is aligned with the opposite direction in which the text is written.<br>If the text width is not specified, the alignment effect may not be obvious when the text width is the same as the width of the parent container.|
| line-height | &lt;length&gt; | 0px | No | Text line height. When this parameter is set to **0px**, the text line height is not limited and the font size is adaptive. |
| text-overflow | string | clip | No | Takes effect when the maximum number of lines is specified. Available values are as follows:<br>- **clip**: The text is clipped and displayed based on the size of the parent container.<br>- **ellipsis**: The text is displayed based on the size of the parent container. The text that cannot be displayed is replaced with ellipsis. This style must be used together with **max-lines**.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| max-lines | number | - | No | Maximum number of lines in the text. |
| min-font-size | &lt;length&gt; | - | No | Minimum font size in the text. This style must be used together with **max-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| max-font-size | &lt;length&gt; | - | No | Maximum font size in the text. This style must be used together with **min-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| font-size-step | &lt;length&gt; | 1px | No | Step for dynamically adjusting the font size in the text. The minimum and maximum font sizes must be set. |
| prefer-font-sizes | &lt;array&gt; | - | No | Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, **text-overflow** is used to truncate the text. If this parameter is set, **font-size**, **max-font-size**, **min-font-size**, and **font-size-step** do not take effect.<br>Example values: **12px,14px,16px**|
<a name="table1066211279710"></a>
<table><thead align="left"><tr id="row46621427876"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p146621527278"><a name="p146621527278"></a><a name="p146621527278"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="p116628273714"><a name="p116628273714"></a><a name="p116628273714"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p1966212272710"><a name="p1966212272710"></a><a name="p1966212272710"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p966211271973"><a name="p966211271973"></a><a name="p966211271973"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p96621527270"><a name="p96621527270"></a><a name="p96621527270"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1566214278715"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p2066212271673"><a name="p2066212271673"></a><a name="p2066212271673"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p36638271178"><a name="p36638271178"></a><a name="p36638271178"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p36631727171"><a name="p36631727171"></a><a name="p36631727171"></a>#e5000000</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1666313271878"><a name="p1666313271878"></a><a name="p1666313271878"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p4663132717711"><a name="p4663132717711"></a><a name="p4663132717711"></a>Text color.</p>
</td>
</tr>
<tr id="row12663102710714"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1666310276712"><a name="p1666310276712"></a><a name="p1666310276712"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p156641127174"><a name="p156641127174"></a><a name="p156641127174"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p196646273713"><a name="p196646273713"></a><a name="p196646273713"></a>30px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p766452710718"><a name="p766452710718"></a><a name="p766452710718"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1766413271577"><a name="p1766413271577"></a><a name="p1766413271577"></a>Font size (px).</p>
</td>
</tr>
<tr id="row0664127878"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p11664112715710"><a name="p11664112715710"></a><a name="p11664112715710"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p86643271179"><a name="p86643271179"></a><a name="p86643271179"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p56642027677"><a name="p56642027677"></a><a name="p56642027677"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p8665127678"><a name="p8665127678"></a><a name="p8665127678"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p566517271977"><a name="p566517271977"></a><a name="p566517271977"></a>Whether the text size changes with the system's font size settings.</p>
<div class="note" id="note166651727377"><a name="note166651727377"></a><a name="note166651727377"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p96651327075"><a name="p96651327075"></a><a name="p96651327075"></a>For details about how to make the configuration take effect dynamically, see the <strong id="b140963492841533"><a name="b140963492841533"></a><a name="b140963492841533"></a>config-changes</strong> attribute in the <strong id="b40058943041533"><a name="b40058943041533"></a><a name="b40058943041533"></a>config.json</strong> file.</p>
</div></div>
</td>
</tr>
<tr id="row96651127874"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p966532714714"><a name="p966532714714"></a><a name="p966532714714"></a>letter-spacing</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p26651427176"><a name="p26651427176"></a><a name="p26651427176"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p866516277712"><a name="p866516277712"></a><a name="p866516277712"></a>0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p15665122712718"><a name="p15665122712718"></a><a name="p15665122712718"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p176651271078"><a name="p176651271078"></a><a name="p176651271078"></a>Character spacing (px).</p>
</td>
</tr>
<tr id="row1266517271779"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p8666192719720"><a name="p8666192719720"></a><a name="p8666192719720"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p06663271679"><a name="p06663271679"></a><a name="p06663271679"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p66668271711"><a name="p66668271711"></a><a name="p66668271711"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1966622718710"><a name="p1966622718710"></a><a name="p1966622718710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p156661927476"><a name="p156661927476"></a><a name="p156661927476"></a>Font style. Available values are as follows:</p>
<a name="ul16666271173"></a><a name="ul16666271173"></a><ul id="ul16666271173"><li><strong id="b83400171541533"><a name="b83400171541533"></a><a name="b83400171541533"></a>normal</strong>: standard font style</li><li><strong id="b38004254941533"><a name="b38004254941533"></a><a name="b38004254941533"></a>italic</strong>: italic font style</li></ul>
</td>
</tr>
<tr id="row12666127173"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p2066662710710"><a name="p2066662710710"></a><a name="p2066662710710"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p366612271275"><a name="p366612271275"></a><a name="p366612271275"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p136664271275"><a name="p136664271275"></a><a name="p136664271275"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p366672716711"><a name="p366672716711"></a><a name="p366672716711"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1966612271713"><a name="p1966612271713"></a><a name="p1966612271713"></a>Font width. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a larger font width.</p>
<div class="note" id="note36663271078"><a name="note36663271078"></a><a name="note36663271078"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p20666132718711"><a name="p20666132718711"></a><a name="p20666132718711"></a>The value must be an integer multiple of 100.</p>
</div></div>
<p id="p5666182717710"><a name="p5666182717710"></a><a name="p5666182717710"></a>The value of the string type can be <strong id="b132902811341533"><a name="b132902811341533"></a><a name="b132902811341533"></a>lighter</strong>, <strong id="b70405315341533"><a name="b70405315341533"></a><a name="b70405315341533"></a>normal</strong>, <strong id="b21613477941533"><a name="b21613477941533"></a><a name="b21613477941533"></a>bold</strong>, or <strong id="b161719670941533"><a name="b161719670941533"></a><a name="b161719670941533"></a>bolder</strong>.</p>
</td>
</tr>
<tr id="row766612271976"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p196661427579"><a name="p196661427579"></a><a name="p196661427579"></a>text-decoration</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p86662271373"><a name="p86662271373"></a><a name="p86662271373"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p066742714719"><a name="p066742714719"></a><a name="p066742714719"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p46671227774"><a name="p46671227774"></a><a name="p46671227774"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p166715271479"><a name="p166715271479"></a><a name="p166715271479"></a>Text decoration. Available values are as follows:</p>
<a name="ul2667127575"></a><a name="ul2667127575"></a><ul id="ul2667127575"><li><strong id="b81406780441533"><a name="b81406780441533"></a><a name="b81406780441533"></a>underline</strong>: An underline is used.</li><li><strong id="b83360459041533"><a name="b83360459041533"></a><a name="b83360459041533"></a>line-through</strong>: A strikethrough is used.</li><li><strong id="b155693540941533"><a name="b155693540941533"></a><a name="b155693540941533"></a>none</strong>: The standard text is used.</li></ul>
</td>
</tr>
<tr id="row2066710275712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p206671427577"><a name="p206671427577"></a><a name="p206671427577"></a>text-align</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p166713271273"><a name="p166713271273"></a><a name="p166713271273"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1366722713718"><a name="p1366722713718"></a><a name="p1366722713718"></a>start</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1366782713713"><a name="p1366782713713"></a><a name="p1366782713713"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p106677271479"><a name="p106677271479"></a><a name="p106677271479"></a>Text alignment mode. Available values are as follows:</p>
<a name="ul1466712710712"></a><a name="ul1466712710712"></a><ul id="ul1466712710712"><li><strong id="b68270085441533"><a name="b68270085441533"></a><a name="b68270085441533"></a>left</strong>: The text is left-aligned.</li><li><strong id="b159806762441533"><a name="b159806762441533"></a><a name="b159806762441533"></a>center</strong>: The text is center-aligned.</li><li><strong id="b169036087341533"><a name="b169036087341533"></a><a name="b169036087341533"></a>right</strong>: The text is right-aligned.</li><li><strong id="b195938376541533"><a name="b195938376541533"></a><a name="b195938376541533"></a>start</strong>: The text is aligned with the direction in which the text is written.</li><li><strong id="b73543552641533"><a name="b73543552641533"></a><a name="b73543552641533"></a>end</strong>: The text is aligned with the opposite direction in which the text is written. </li></ul>
<div class="note" id="note3668172719712"><a name="note3668172719712"></a><a name="note3668172719712"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p366818278713"><a name="p366818278713"></a><a name="p366818278713"></a>If the text width is not specified, the alignment effect may not be obvious when the text width is the same as the width of the parent container. </p>
</div></div>
</td>
</tr>
<tr id="row1666814271174"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p466814271271"><a name="p466814271271"></a><a name="p466814271271"></a>line-height</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p46686271711"><a name="p46686271711"></a><a name="p46686271711"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1866816277720"><a name="p1866816277720"></a><a name="p1866816277720"></a>0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p866814273713"><a name="p866814273713"></a><a name="p866814273713"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p126682027579"><a name="p126682027579"></a><a name="p126682027579"></a>Text line height. When this parameter is set to <strong id="b90821727741533"><a name="b90821727741533"></a><a name="b90821727741533"></a>0px</strong>, the text line height is not limited and the font size is adaptive.</p>
</td>
</tr>
<tr id="row16688275710"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p7668102717718"><a name="p7668102717718"></a><a name="p7668102717718"></a>text-overflow</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p1166816271176"><a name="p1166816271176"></a><a name="p1166816271176"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1466832717712"><a name="p1466832717712"></a><a name="p1466832717712"></a>clip</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p8668527276"><a name="p8668527276"></a><a name="p8668527276"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p116681327179"><a name="p116681327179"></a><a name="p116681327179"></a><span id="p5a4b24dbf2784092965d788cce471596"><a name="p5a4b24dbf2784092965d788cce471596"></a><a name="p5a4b24dbf2784092965d788cce471596"></a>Takes effect when the maximum number of lines is specified. </span>Available values are as follows:</p>
<a name="ul1668162716714"></a><a name="ul1668162716714"></a><ul id="ul1668162716714"><li><strong id="b8200292041533"><a name="b8200292041533"></a><a name="b8200292041533"></a>clip</strong>: The text is clipped and displayed based on the size of the parent container.</li><li><strong id="b159529937541533"><a name="b159529937541533"></a><a name="b159529937541533"></a>ellipsis</strong>: The text is displayed based on the size of the parent container. The text that cannot be displayed is replaced with ellipsis. This style must be used together with <strong id="b212203499741533"><a name="b212203499741533"></a><a name="b212203499741533"></a>max-lines</strong>.</li></ul>
</td>
</tr>
<tr id="row1066915272078"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1466914271711"><a name="p1466914271711"></a><a name="p1466914271711"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p566920276718"><a name="p566920276718"></a><a name="p566920276718"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1366916271715"><a name="p1366916271715"></a><a name="p1366916271715"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1866982718716"><a name="p1866982718716"></a><a name="p1866982718716"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p56695278715"><a name="p56695278715"></a><a name="p56695278715"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> in the family is selected as the font for the text. </p>
</td>
</tr>
<tr id="row20670142717711"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p967019271873"><a name="p967019271873"></a><a name="p967019271873"></a>max-lines</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p6670927478"><a name="p6670927478"></a><a name="p6670927478"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p156701327474"><a name="p156701327474"></a><a name="p156701327474"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p86701527470"><a name="p86701527470"></a><a name="p86701527470"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p567016271173"><a name="p567016271173"></a><a name="p567016271173"></a>Maximum number of lines in the text.</p>
</td>
</tr>
<tr id="row96703271573"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p867018271277"><a name="p867018271277"></a><a name="p867018271277"></a>min-font-size</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p106711627870"><a name="p106711627870"></a><a name="p106711627870"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p5671142714711"><a name="p5671142714711"></a><a name="p5671142714711"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p16711827779"><a name="p16711827779"></a><a name="p16711827779"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p467152714715"><a name="p467152714715"></a><a name="p467152714715"></a>Minimum font size in the text. This style must be used together with <strong id="b107353746741533"><a name="b107353746741533"></a><a name="b107353746741533"></a>max-font-size</strong>. The font size can be changed dynamically. After the maximum and minimum font sizes are set, <strong id="b116057394841533"><a name="b116057394841533"></a><a name="b116057394841533"></a>font-size</strong> does not take effect.</p>
</td>
</tr>
<tr id="row8671427875"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p7671627270"><a name="p7671627270"></a><a name="p7671627270"></a>max-font-size</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p367132713718"><a name="p367132713718"></a><a name="p367132713718"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p56711527973"><a name="p56711527973"></a><a name="p56711527973"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p167192710715"><a name="p167192710715"></a><a name="p167192710715"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p56711927074"><a name="p56711927074"></a><a name="p56711927074"></a>Maximum font size in the text. This style must be used together with <strong id="b141713431641533"><a name="b141713431641533"></a><a name="b141713431641533"></a>min-font-size</strong>. The font size can be changed dynamically. After the maximum and minimum font sizes are set, <strong id="b130346143141533"><a name="b130346143141533"></a><a name="b130346143141533"></a>font-size</strong> does not take effect.</p>
</td>
</tr>
<tr id="row56715276716"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p3671162714713"><a name="p3671162714713"></a><a name="p3671162714713"></a>font-size-step</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p66721027579"><a name="p66721027579"></a><a name="p66721027579"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p967218271371"><a name="p967218271371"></a><a name="p967218271371"></a>1px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p116725271975"><a name="p116725271975"></a><a name="p116725271975"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1767210271875"><a name="p1767210271875"></a><a name="p1767210271875"></a>Step for dynamically adjusting the font size in the text. The minimum and maximum font sizes must be set.</p>
</td>
</tr>
<tr id="row5672122720713"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p136729271873"><a name="p136729271873"></a><a name="p136729271873"></a>prefer-font-sizes</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p367222719714"><a name="p367222719714"></a><a name="p367222719714"></a>&lt;array&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1167212719720"><a name="p1167212719720"></a><a name="p1167212719720"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p56724271375"><a name="p56724271375"></a><a name="p56724271375"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1167292716713"><a name="p1167292716713"></a><a name="p1167292716713"></a>Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, <strong id="b191381972441533"><a name="b191381972441533"></a><a name="b191381972441533"></a>text-overflow</strong> is used to truncate the text. If this parameter is set, <strong id="b198803051641533"><a name="b198803051641533"></a><a name="b198803051641533"></a>font-size</strong>, <strong id="b39764528141533"><a name="b39764528141533"></a><a name="b39764528141533"></a>max-font-size</strong>, <strong id="b87795574141533"><a name="b87795574141533"></a><a name="b87795574141533"></a>min-font-size</strong>, and <strong id="b138745821741533"><a name="b138745821741533"></a><a name="b138745821741533"></a>font-size-step</strong> do not take effect.</p>
<p id="p146730271171"><a name="p146730271171"></a><a name="p146730271171"></a>Example values: <strong id="b585484815435"><a name="b585484815435"></a><a name="b585484815435"></a>12px,14px,16px</strong></p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section57301035448"></a> ## Events
Not supported Not supported
## Methods<a name="section340215162812"></a>
## Methods
Not supported Not supported
## Example Code<a name="section1018514431132"></a>
``` ## Example
```html
<!--xxx.hml --> <!--xxx.hml -->
<div class="container"> <div class="container">
<div class="row"> <div class="row">
...@@ -277,7 +79,7 @@ Not supported ...@@ -277,7 +79,7 @@ Not supported
</div> </div>
``` ```
``` ```css
/*xxx.css */ /*xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -296,5 +98,4 @@ Not supported ...@@ -296,5 +98,4 @@ Not supported
} }
``` ```
![](figures/en-us_image_0000001152834002.png) ![en-us_image_0000001152834002](figures/en-us_image_0000001152834002.png)
# menu<a name="EN-US_TOPIC_0000001173164715"></a> # menu
The **<menu\>** component provides menus as temporary pop-up windows to display operations that can be performed by users. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<menu>** component provides menus as temporary pop-up windows to display operations that can be performed by users.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
**[<option\>](js-components-basic-option.md)** ## Child Components
Only the **[\<option>](../arkui-js/js-components-basic-option.md)** component is supported.
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
## Attributes<a name="section2907183951110"></a> | Name | Type | Default Value | Mandatory | Description |
| ------ | ------ | ----- | ---- | ---------------------------------------- |
| target | string | - | No | Target element to which the menu is attached. When the target element is clicked, the menu is automatically displayed. The menu is preferentially displayed in the lower right corner of the target element. If the visible space on the right is insufficient, the menu is moved leftward. If the visible space in the lower part is insufficient, the menu is moved upward.|
| type | string | click | No | Mode in which the target element triggers the pop-up menu. Available values are as follows:<br>- **click**: The pop-up menu is triggered by clicking the target element.<br>- **longpress**: The pop-up menu is triggered by long pressing the target element.|
| title | string | - | No | Title of the menu. |
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. > **NOTE**
>
> The **focusable** and **disabled** attributes are not supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row20739039202112"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p12805174016214"><a name="p12805174016214"></a><a name="p12805174016214"></a>target</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p0805154015212"><a name="p0805154015212"></a><a name="p0805154015212"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p14805134011215"><a name="p14805134011215"></a><a name="p14805134011215"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p17805194002114"><a name="p17805194002114"></a><a name="p17805194002114"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p168053400214"><a name="p168053400214"></a><a name="p168053400214"></a>Target element selector. After the target element selector is used, a menu is automatically displayed when you click the target element. The pop-up menu is preferentially displayed in the lower right corner of the target element. When the visible space on the right is insufficient, the menu is moved leftward. When the visible space in the lower part is insufficient, the menu is moved upward.</p>
</td>
</tr>
<tr id="row1131933611219"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p380514401217"><a name="p380514401217"></a><a name="p380514401217"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p380511401214"><a name="p380511401214"></a><a name="p380511401214"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p3805174011211"><a name="p3805174011211"></a><a name="p3805174011211"></a>click</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1805124013218"><a name="p1805124013218"></a><a name="p1805124013218"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p11805124032118"><a name="p11805124032118"></a><a name="p11805124032118"></a>Mode in which the target element triggers the pop-up window. Available values are as follows:</p>
<a name="ul168051640152119"></a><a name="ul168051640152119"></a><ul id="ul168051640152119"><li><strong id="b363812611517"><a name="b363812611517"></a><a name="b363812611517"></a>click</strong>: Click the element to trigger the pop-up window.</li><li><strong id="b193081910125114"><a name="b193081910125114"></a><a name="b193081910125114"></a>longpress</strong>: Press and hold the element to trigger the pop-up window.</li></ul>
</td>
</tr>
<tr id="row142917338215"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p6805840192110"><a name="p6805840192110"></a><a name="p6805840192110"></a>title</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p7805640162120"><a name="p7805640162120"></a><a name="p7805640162120"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1805104018214"><a name="p1805104018214"></a><a name="p1805104018214"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p158051240102116"><a name="p158051240102116"></a><a name="p158051240102116"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p780544014218"><a name="p780544014218"></a><a name="p780544014218"></a>Title of the pop-up window.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:** ## Styles
>The **focusable** and **disabled** attributes are not supported.
## Styles<a name="section1382826121311"></a> The following styles are supported.
Only the following style attributes are supported. | Name | Type | Default Value | Mandatory | Description |
| -------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| text-color | &lt;color&gt; | - | No | Font color of the menu. |
| font-size | &lt;length&gt; | 30px | No | Font size of the menu. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| letter-spacing | &lt;length&gt; | 0 | No | Character spacing of the menu. |
| font-style | string | normal | No | Font style of the menu. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component. |
| font-weight | number \| string | normal | No | Font weight of the menu. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component. |
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
<a name="table1382926171312"></a>
<table><thead align="left"><tr id="row4827267131"><th class="cellrowborder" valign="top" width="19.038096190380962%" id="mcps1.1.6.1.1"><p id="p14838267137"><a name="p14838267137"></a><a name="p14838267137"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.847615238476152%" id="mcps1.1.6.1.2"><p id="p283172611317"><a name="p283172611317"></a><a name="p283172611317"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.118788121187881%" id="mcps1.1.6.1.3"><p id="p88312621315"><a name="p88312621315"></a><a name="p88312621315"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8.269173082691731%" id="mcps1.1.6.1.4"><p id="p2083112611314"><a name="p2083112611314"></a><a name="p2083112611314"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="36.72632736726327%" id="mcps1.1.6.1.5"><p id="p1783122611133"><a name="p1783122611133"></a><a name="p1783122611133"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row3836265139"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p1983152617134"><a name="p1983152617134"></a><a name="p1983152617134"></a>text-color</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p128332611313"><a name="p128332611313"></a><a name="p128332611313"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p283192611138"><a name="p283192611138"></a><a name="p283192611138"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p38312262131"><a name="p38312262131"></a><a name="p38312262131"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p1283152651317"><a name="p1283152651317"></a><a name="p1283152651317"></a>Font color of the menu.</p>
</td>
</tr>
<tr id="row483152611133"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p88319262136"><a name="p88319262136"></a><a name="p88319262136"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p584192617139"><a name="p584192617139"></a><a name="p584192617139"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p168412265131"><a name="p168412265131"></a><a name="p168412265131"></a>30px</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p884112616132"><a name="p884112616132"></a><a name="p884112616132"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p138462651315"><a name="p138462651315"></a><a name="p138462651315"></a>Font size of the menu.</p>
</td>
</tr>
<tr id="row984102651311"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p208462681319"><a name="p208462681319"></a><a name="p208462681319"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p1584626161319"><a name="p1584626161319"></a><a name="p1584626161319"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p1184192681319"><a name="p1184192681319"></a><a name="p1184192681319"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p1184142612131"><a name="p1184142612131"></a><a name="p1184142612131"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p6849264138"><a name="p6849264138"></a><a name="p6849264138"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note984226191312"><a name="note984226191312"></a><a name="note984226191312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p58442621310"><a name="p58442621310"></a><a name="p58442621310"></a>If the <strong id="b3847171311256"><a name="b3847171311256"></a><a name="b3847171311256"></a>config-changes</strong> tag of <strong id="b38541913152512"><a name="b38541913152512"></a><a name="b38541913152512"></a>fontSize</strong> is configured for abilities in the <strong id="b15854713182513"><a name="b15854713182513"></a><a name="b15854713182513"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="row0848266134"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p108417267136"><a name="p108417267136"></a><a name="p108417267136"></a>letter-spacing</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p19851226111314"><a name="p19851226111314"></a><a name="p19851226111314"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p11851526131317"><a name="p11851526131317"></a><a name="p11851526131317"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p1085112601315"><a name="p1085112601315"></a><a name="p1085112601315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p1585102611312"><a name="p1585102611312"></a><a name="p1585102611312"></a>Character spacing of the menu.</p>
</td>
</tr>
<tr id="row198512611311"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p58542612137"><a name="p58542612137"></a><a name="p58542612137"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p1385526141314"><a name="p1385526141314"></a><a name="p1385526141314"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p0854265135"><a name="p0854265135"></a><a name="p0854265135"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p68511266136"><a name="p68511266136"></a><a name="p68511266136"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p1985126101319"><a name="p1985126101319"></a><a name="p1985126101319"></a>Font style of the menu. For details, see <a href="js-components-basic-text.md#section5775351116">font-style</a> of the <strong id="b15474121215508"><a name="b15474121215508"></a><a name="b15474121215508"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row1485326141319"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p78572651318"><a name="p78572651318"></a><a name="p78572651318"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p4856268132"><a name="p4856268132"></a><a name="p4856268132"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p68572616131"><a name="p68572616131"></a><a name="p68572616131"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p168572615134"><a name="p168572615134"></a><a name="p168572615134"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p138542681312"><a name="p138542681312"></a><a name="p138542681312"></a>Font weight of the menu. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b254187164920"><a name="b254187164920"></a><a name="b254187164920"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row88516264133"><td class="cellrowborder" valign="top" width="19.038096190380962%" headers="mcps1.1.6.1.1 "><p id="p28512618133"><a name="p28512618133"></a><a name="p28512618133"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="23.847615238476152%" headers="mcps1.1.6.1.2 "><p id="p285182651315"><a name="p285182651315"></a><a name="p285182651315"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.118788121187881%" headers="mcps1.1.6.1.3 "><p id="p16851626111320"><a name="p16851626111320"></a><a name="p16851626111320"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="8.269173082691731%" headers="mcps1.1.6.1.4 "><p id="p12856267138"><a name="p12856267138"></a><a name="p12856267138"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.72632736726327%" headers="mcps1.1.6.1.5 "><p id="p178632614139"><a name="p178632614139"></a><a name="p178632614139"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> in the family is selected as the font for the text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section5624519222"></a> ## Events
The following events are supported. The following events are supported.
<a name="table116210562217"></a> | Name | Parameter | Description |
<table><thead align="left"><tr id="row2062135192210"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p166255172219"><a name="p166255172219"></a><a name="p166255172219"></a>Name</p> | -------- | ------------------------- | ---------------------------------------- |
</th> | selected | { value:value } | Triggered when a value in the menu is selected. The return value is the **value** attribute of the **\<option>** component.|
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p76225152215"><a name="p76225152215"></a><a name="p76225152215"></a>Parameter</p> | cancel | - | Triggered when an operation is canceled by the user. |
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p0621562216"><a name="p0621562216"></a><a name="p0621562216"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row19622532212"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p5629512216"><a name="p5629512216"></a><a name="p5629512216"></a>selected</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p6621258220"><a name="p6621258220"></a><a name="p6621258220"></a>{ value:value }</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p963205112214"><a name="p963205112214"></a><a name="p963205112214"></a>Triggered when a value in the menu is selected. The returned value is the <strong id="b8348518817"><a name="b8348518817"></a><a name="b8348518817"></a>value</strong> attribute of the <strong id="b46757201362"><a name="b46757201362"></a><a name="b46757201362"></a>&lt;option&gt;</strong> component.</p>
</td>
</tr>
<tr id="row13636516229"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p463550229"><a name="p463550229"></a><a name="p463550229"></a>cancel</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p17633542217"><a name="p17633542217"></a><a name="p17633542217"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p6639512225"><a name="p6639512225"></a><a name="p6639512225"></a>Triggered when an operation is canceled by the user</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section47669296127"></a>
## Methods
The following methods are supported. The following methods are supported.
<a name="table5423142414911"></a> | Name | Parameter | Description |
<table><thead align="left"><tr id="row342362484919"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p2423924114916"><a name="p2423924114916"></a><a name="p2423924114916"></a>Name</p> | ---- | --------------------------------- | ---------------------------------------- |
</th> | show | { x:x, y:y } | Displays the menu. **x** and **y** specify the position of the displayed menu. **x** indicates the x coordinate from the left edge of the visible area, and does not include any scrolling offset. **y** indicates the y coordinate from the upper edge of the visible area, and does not include any scrolling offset or a status bar. The menu is preferentially displayed in the lower right corner of the target element. If the visible space on the right is insufficient, the menu is moved leftward. If the visible space in the lower part is insufficient, the menu is moved upward.|
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p124231524104914"><a name="p124231524104914"></a><a name="p124231524104914"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p104230246498"><a name="p104230246498"></a><a name="p104230246498"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1642392418498"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p165281286428"><a name="p165281286428"></a><a name="p165281286428"></a>show</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p9528428204212"><a name="p9528428204212"></a><a name="p9528428204212"></a>{ x:x, y:y }</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p11528112816422"><a name="p11528112816422"></a><a name="p11528112816422"></a>Displays the menu. <em id="i41846563220"><a name="i41846563220"></a><a name="i41846563220"></a>x</em> and <em id="i9806858529"><a name="i9806858529"></a><a name="i9806858529"></a>y</em> specify the position of the displayed menu. <em id="i1683071319418"><a name="i1683071319418"></a><a name="i1683071319418"></a>x</em> indicates the X-axis coordinate from the left edge of the visible area, and does not include any scrolling offset. <em id="i1864241546"><a name="i1864241546"></a><a name="i1864241546"></a>y</em> indicates the Y-axis coordinate from the upper edge of the visible area, and does not include any scrolling offset or a status bar. The menu is preferentially displayed in the lower right corner. When the visible space on the right is insufficient, the menu is moved leftward. When the visible space in the lower part is insufficient, the menu is moved upward.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section54636714136"></a> ## Example
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text onclick="onTextClick" class="title-text">Show popup menu.</text> <text onclick="onTextClick" class="title-text">Show popup menu.</text>
...@@ -233,7 +78,7 @@ The following methods are supported. ...@@ -233,7 +78,7 @@ The following methods are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -245,7 +90,7 @@ The following methods are supported. ...@@ -245,7 +90,7 @@ The following methods are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -260,5 +105,4 @@ export default { ...@@ -260,5 +105,4 @@ export default {
} }
``` ```
![](figures/menu13.gif) ![menu13](figures/menu13.gif)
# option<a name="EN-US_TOPIC_0000001127125028"></a> # option
When used as a child component of **<[select](js-components-basic-select.md)\>**, the **<option\>** component is used to display items in the drop-down list. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
When used as a child component of **<[menu](js-components-basic-menu.md)\>**, the **<option\>** component is used to display items in the displayed menu. When used as a child component of **[\<select>](../arkui-js/js-components-basic-select.md)**, the **\<option>** component is used to display items in the drop-down list.
## Required Permissions<a name="section11257113618419"></a>
None When used as a child component of **[\<menu>](../arkui-js/js-components-basic-menu.md)**, the **\<option>** component is used to display items in the displayed menu.
## Child Component<a name="section9288143101012"></a> ## Required Permissions
None None
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1518719174474"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="a883fd418b15f44aab62cb432b06673c4"><a name="a883fd418b15f44aab62cb432b06673c4"></a><a name="a883fd418b15f44aab62cb432b06673c4"></a>selected</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="afc56b8abb2534994b62d433a905471c7"><a name="afc56b8abb2534994b62d433a905471c7"></a><a name="afc56b8abb2534994b62d433a905471c7"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="ae97849073e88424bbe1d389b984956f1"><a name="ae97849073e88424bbe1d389b984956f1"></a><a name="ae97849073e88424bbe1d389b984956f1"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="a91102d93137e4b189678fa366af8fbcf"><a name="a91102d93137e4b189678fa366af8fbcf"></a><a name="a91102d93137e4b189678fa366af8fbcf"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="a17bb7bb8f011471f9527ca6bfb6ab15d"><a name="a17bb7bb8f011471f9527ca6bfb6ab15d"></a><a name="a17bb7bb8f011471f9527ca6bfb6ab15d"></a>Whether an option is the default option in the drop-down list. This attribute is available only when the parent component is <strong id="b114851051123511"><a name="b114851051123511"></a><a name="b114851051123511"></a>&lt;select&gt;</strong>.</p>
</td>
</tr>
<tr id="row685281464718"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="a7d9da77d616d46eea405d2773043efa4"><a name="a7d9da77d616d46eea405d2773043efa4"></a><a name="a7d9da77d616d46eea405d2773043efa4"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="a160704c9307f481db3132fdc9699124e"><a name="a160704c9307f481db3132fdc9699124e"></a><a name="a160704c9307f481db3132fdc9699124e"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="a9cad6471925043e7aa7d55c4b1fae551"><a name="a9cad6471925043e7aa7d55c4b1fae551"></a><a name="a9cad6471925043e7aa7d55c4b1fae551"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="ad0233f7d2ac4447facb335d36c8acfc5"><a name="ad0233f7d2ac4447facb335d36c8acfc5"></a><a name="ad0233f7d2ac4447facb335d36c8acfc5"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1145911181476"><a name="p1145911181476"></a><a name="p1145911181476"></a>Value of an option, which is used as the return value of the selected event of the <strong id="b984993812421"><a name="b984993812421"></a><a name="b984993812421"></a>&lt;select&gt;</strong>or <strong id="b136061622193920"><a name="b136061622193920"></a><a name="b136061622193920"></a>&lt;menu&gt;</strong> parent component.</p>
<div class="note" id="note174591818114715"><a name="note174591818114715"></a><a name="note174591818114715"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p9459218134716"><a name="p9459218134716"></a><a name="p9459218134716"></a>The option value to be displayed on the UI must be put between the start and end tags, for example, <strong id="b1333453312333"><a name="b1333453312333"></a><a name="b1333453312333"></a>&lt;option value="10"&gt;October&lt;/option&gt;</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row1221312129475"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p124597184479"><a name="p124597184479"></a><a name="p124597184479"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p445961814719"><a name="p445961814719"></a><a name="p445961814719"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p345971813473"><a name="p345971813473"></a><a name="p345971813473"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1745919188470"><a name="p1745919188470"></a><a name="p1745919188470"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p164596188472"><a name="p164596188472"></a><a name="p164596188472"></a>Icon resource path. This icon is displayed before the option text. The supported icon formats are JPG, PNG, and SVG.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
The following style attributes are supported.
<a name="t2420cc4f2a7a48afbeb83cb4e0d3c481"></a>
<table><thead align="left"><tr id="r0684f76f60eb45279db68f515f4bf61c"><th class="cellrowborder" valign="top" width="18.81188118811881%" id="mcps1.1.6.1.1"><p id="a483bf3731e274a69a3318680ab8d294d"><a name="a483bf3731e274a69a3318680ab8d294d"></a><a name="a483bf3731e274a69a3318680ab8d294d"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="24.752475247524753%" id="mcps1.1.6.1.2"><p id="a668752fdd289488894b824c67145a35a"><a name="a668752fdd289488894b824c67145a35a"></a><a name="a668752fdd289488894b824c67145a35a"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.1.6.1.3"><p id="af7492efe635a4c36ae86a2ddea34b1bd"><a name="af7492efe635a4c36ae86a2ddea34b1bd"></a><a name="af7492efe635a4c36ae86a2ddea34b1bd"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.900990099009901%" id="mcps1.1.6.1.4"><p id="a003e28cad63a485b9eebb109f46c7309"><a name="a003e28cad63a485b9eebb109f46c7309"></a><a name="a003e28cad63a485b9eebb109f46c7309"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="30.693069306930692%" id="mcps1.1.6.1.5"><p id="a8f798a93681e4bd2a9965529fb6bc20f"><a name="a8f798a93681e4bd2a9965529fb6bc20f"></a><a name="a8f798a93681e4bd2a9965529fb6bc20f"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="rabeceb58645f41759ef590abd1094c11"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="a61b4d670b9de4435ba57801f6f7a937e"><a name="a61b4d670b9de4435ba57801f6f7a937e"></a><a name="a61b4d670b9de4435ba57801f6f7a937e"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="a9599239e7edf405e9930713ee7191e15"><a name="a9599239e7edf405e9930713ee7191e15"></a><a name="a9599239e7edf405e9930713ee7191e15"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="ad470728c1d9146afb164db59bf59c473"><a name="ad470728c1d9146afb164db59bf59c473"></a><a name="ad470728c1d9146afb164db59bf59c473"></a>#e6000000</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="a00dda7f922aa4782b4ed6a92a98d5d1b"><a name="a00dda7f922aa4782b4ed6a92a98d5d1b"></a><a name="a00dda7f922aa4782b4ed6a92a98d5d1b"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="a64508ed81c5b4b3ca9def0fefae31f36"><a name="a64508ed81c5b4b3ca9def0fefae31f36"></a><a name="a64508ed81c5b4b3ca9def0fefae31f36"></a>Text color of the options.</p>
</td>
</tr>
<tr id="rc7beaf0e35194f4b821333f3aa91aefc"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="a71b1da3d23d54fd6bfbba190ca91b4da"><a name="a71b1da3d23d54fd6bfbba190ca91b4da"></a><a name="a71b1da3d23d54fd6bfbba190ca91b4da"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="a3c24ccd1f1274cb5ba9496ed322fa6e4"><a name="a3c24ccd1f1274cb5ba9496ed322fa6e4"></a><a name="a3c24ccd1f1274cb5ba9496ed322fa6e4"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="adec9bcad945f4c0da077f460787a55b3"><a name="adec9bcad945f4c0da077f460787a55b3"></a><a name="adec9bcad945f4c0da077f460787a55b3"></a>16px</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="a955d1ce0c7824017aa55b4c1a629e63d"><a name="a955d1ce0c7824017aa55b4c1a629e63d"></a><a name="a955d1ce0c7824017aa55b4c1a629e63d"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="a0d0c0048474b4540bc4bc2dd11775ac6"><a name="a0d0c0048474b4540bc4bc2dd11775ac6"></a><a name="a0d0c0048474b4540bc4bc2dd11775ac6"></a>Font size of the options.</p>
</td>
</tr>
<tr id="row810552892"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="p523512225579"><a name="p523512225579"></a><a name="p523512225579"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="p923522212570"><a name="p923522212570"></a><a name="p923522212570"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="p11235322145714"><a name="p11235322145714"></a><a name="p11235322145714"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="p12235112285712"><a name="p12235112285712"></a><a name="p12235112285712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="p1023513229570"><a name="p1023513229570"></a><a name="p1023513229570"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note1467145631615"><a name="note1467145631615"></a><a name="note1467145631615"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p126785616164"><a name="p126785616164"></a><a name="p126785616164"></a>If the <strong id="b524714361237"><a name="b524714361237"></a><a name="b524714361237"></a>config-changes</strong> tag of <strong id="b19256136236"><a name="b19256136236"></a><a name="b19256136236"></a>fontSize</strong> is configured for abilities in the <strong id="b32576360318"><a name="b32576360318"></a><a name="b32576360318"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="rdf236cf1bf6e427e9f1eda9b51897b65"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="aaa79d478172148f49b57a9b61bb1c2aa"><a name="aaa79d478172148f49b57a9b61bb1c2aa"></a><a name="aaa79d478172148f49b57a9b61bb1c2aa"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="aaa011c1dbd094e6f9d00109bcba267c0"><a name="aaa011c1dbd094e6f9d00109bcba267c0"></a><a name="aaa011c1dbd094e6f9d00109bcba267c0"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="a6f998aca924d438b89f36ffbb2c4d32d"><a name="a6f998aca924d438b89f36ffbb2c4d32d"></a><a name="a6f998aca924d438b89f36ffbb2c4d32d"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="af2332b705d6447acb25117940e7f3c30"><a name="af2332b705d6447acb25117940e7f3c30"></a><a name="af2332b705d6447acb25117940e7f3c30"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="aaba88a62d1484a5a884cfc516e68f949"><a name="aaba88a62d1484a5a884cfc516e68f949"></a><a name="aaba88a62d1484a5a884cfc516e68f949"></a>Font weight. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b9496182195214"><a name="b9496182195214"></a><a name="b9496182195214"></a>text</strong> component.</p>
</td>
</tr>
<tr id="re1d34ad1822943cebad252df6e510f95"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="af8be974b93b0494f98525507cef59575"><a name="af8be974b93b0494f98525507cef59575"></a><a name="af8be974b93b0494f98525507cef59575"></a>text-decoration</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="a292b2c30ba414fd2b2ad98140f566fb7"><a name="a292b2c30ba414fd2b2ad98140f566fb7"></a><a name="a292b2c30ba414fd2b2ad98140f566fb7"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="a37a3613403c7436d959537a24cce65aa"><a name="a37a3613403c7436d959537a24cce65aa"></a><a name="a37a3613403c7436d959537a24cce65aa"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="a6d9989e17ccc41fc98a868e93bcba305"><a name="a6d9989e17ccc41fc98a868e93bcba305"></a><a name="a6d9989e17ccc41fc98a868e93bcba305"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="aad7a14f50e664992800a990ae4261aa0"><a name="aad7a14f50e664992800a990ae4261aa0"></a><a name="aad7a14f50e664992800a990ae4261aa0"></a>Text decoration. For details, see <a href="js-components-basic-text.md#section5775351116">text-decoration</a> of the <strong id="b1935201619527"><a name="b1935201619527"></a><a name="b1935201619527"></a>text</strong> component.</p>
</td>
</tr>
<tr id="r551b8b3310cd41c6988d4ea426fdbe15"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.1.6.1.1 "><p id="a382bf204a52142229c5fdaafee11b0ac"><a name="a382bf204a52142229c5fdaafee11b0ac"></a><a name="a382bf204a52142229c5fdaafee11b0ac"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.1.6.1.2 "><p id="af4c827c5dc8640c7b71cef3ab10a8c8a"><a name="af4c827c5dc8640c7b71cef3ab10a8c8a"></a><a name="af4c827c5dc8640c7b71cef3ab10a8c8a"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.3 "><p id="aae19b2b84b70411ca6ebb975825547fc"><a name="aae19b2b84b70411ca6ebb975825547fc"></a><a name="aae19b2b84b70411ca6ebb975825547fc"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.1.6.1.4 "><p id="acd71bec57fbc44b5afea10134cdae523"><a name="acd71bec57fbc44b5afea10134cdae523"></a><a name="acd71bec57fbc44b5afea10134cdae523"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.1.6.1.5 "><p id="a0b6365c7b9874a8796099aa02f73cde2"><a name="a0b6365c7b9874a8796099aa02f73cde2"></a><a name="a0b6365c7b9874a8796099aa02f73cde2"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1013173520328"></a>
None ## Child Components
## Methods<a name="section45101363326"></a> Not supported
None
## Example Code<a name="section7566164416325"></a> ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | ---- | ---- | ---------------------------------------- |
| selected | boolean | - | No | Whether the option is the default option in the drop-down list. This attribute is available only when the parent component is **\<select>**. |
| value | string | - | Yes | Value of the option, which is used as the return value of the **selected** event of the **\<select>** or **\<menu>** parent component.<br>The value to be displayed on the UI must be put between the start and end tags, for example,<br>**\<option value="10">October\</option>**. |
| icon | string | - | No | Icon resource path. This icon is displayed before the option text. The supported icon formats are JPG, PNG, and SVG. |
## Styles
The following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| --------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | \#e6000000 | No | Font color of the option. |
| font-size | &lt;length&gt; | 16px | No | Font size of the option. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| font-weight | number \| string | normal | No | Font weight of the option. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component. |
| text-decoration | string | none | No | Text modification of an option. For details, see **text-decoration** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component. |
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
## Events
Not supported
## Methods
Not supported
For details, see the [menu example code](js-components-basic-menu.md#section54636714136). ## Example
For details, see [Example in menu](../arkui-js/js-components-basic-menu.md#example).
# piece<a name="EN-US_TOPIC_0000001173164767"></a> # piece
An entrance piece that can contain images and text. It is usually used to display receivers, for example, email recipients or message recipients.
## Child Component<a name="section9288143101012"></a>
None
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="14.5014501450145%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.62126212621262%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.03080308030803%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.64066406640664%" id="mcps1.1.6.1.4"><p id="p154141646194"><a name="p154141646194"></a><a name="p154141646194"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="58.2058205820582%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1875918426407"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p15759174219407"><a name="p15759174219407"></a><a name="p15759174219407"></a>content</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p14759184212400"><a name="p14759184212400"></a><a name="p14759184212400"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p575913424403"><a name="p575913424403"></a><a name="p575913424403"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p24156461792"><a name="p24156461792"></a><a name="p24156461792"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p1975944244011"><a name="p1975944244011"></a><a name="p1975944244011"></a>Text content of the operational piece.</p>
</td>
</tr>
<tr id="row1401171483915"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p637566151211"><a name="p637566151211"></a><a name="p637566151211"></a>closable</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p134021148395"><a name="p134021148395"></a><a name="p134021148395"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p1840211418393"><a name="p1840211418393"></a><a name="p1840211418393"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p1415746595"><a name="p1415746595"></a><a name="p1415746595"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p19402201416398"><a name="p19402201416398"></a><a name="p19402201416398"></a>Whether to display the delete icon for the operational piece. When users click the delete icon, it triggers the close event.</p>
</td>
</tr>
<tr id="row78648123418"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p173023953412"><a name="p173023953412"></a><a name="p173023953412"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p530216953412"><a name="p530216953412"></a><a name="p530216953412"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p3302149133418"><a name="p3302149133418"></a><a name="p3302149133418"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p103024953410"><a name="p103024953410"></a><a name="p103024953410"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p230211914342"><a name="p230211914342"></a><a name="p230211914342"></a>URL of the delete icon for the operational piece. The value can be a local path.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section17756476592"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>By default, text and images are placed in the middle of the **<piece\>** component.
## Events<a name="section19137152119"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table3674139193020"></a>
<table><thead align="left"><tr id="row14674539123012"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row418514431304"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p11911549133016"><a name="p11911549133016"></a><a name="p11911549133016"></a>close</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1691204993018"><a name="p1691204993018"></a><a name="p1691204993018"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1891114933015"><a name="p1891114933015"></a><a name="p1891114933015"></a>Triggered when users click the delete icon of the operational piece. You can delete this component by using the <strong id="b1276472010487"><a name="b1276472010487"></a><a name="b1276472010487"></a>if</strong> directive.</p>
</td>
</tr>
</tbody>
</table>
## Method<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section118886119320"></a>
``` > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
The **\<piece>** component provides an entrance piece that can contain images and text. It is usually used to display receivers, for example, email recipients or message recipients.
## Child Components
Not supported
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Mandatory| Description |
| -------- | ------- | ---- | ------------------------------------------------------------ |
| content | string | Yes | Text content of the operational piece. |
| closable | boolean | No | Whether to display the delete icon for the operational piece. When users click the delete icon, it triggers the close event.<br>Default value: **false**|
| icon | string | No | URL of the delete icon for the operational piece. The value can be a local path. |
## Styles
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
> **NOTE**
>
> By default, text and images are placed in the middle of the **\<piece>** component.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
| ----- | ---- | ----------------------------------- |
| close | - | Triggered when users click the delete icon of the operational piece. You can delete this component by using the **if** directive.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml--> <!-- xxx.hml-->
<div class="container" > <div class="container" >
<piece if="{{first}}" content="example"></piece> <piece if="{{first}}" content="example"></piece>
...@@ -103,7 +54,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -103,7 +54,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
width: 100%; width: 100%;
...@@ -113,7 +64,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -113,7 +64,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -126,5 +77,4 @@ export default { ...@@ -126,5 +77,4 @@ export default {
} }
``` ```
![](figures/11-5.gif) ![11-5](figures/11-5.gif)
# progress<a name="EN-US_TOPIC_0000001173324665"></a> # progress
The **<progress\>** component is used to provide a progress bar that displays the progress of content loading or operation processing. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<Progress>** component is used to provide a progress bar that displays the progress of content loading or an operation.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
## Attributes
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p> | Name | Type | Default Value | Mandatory | Description |
</th> | ---- | ------ | ---------- | ---- | ---------------------------------------- |
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p> | type | string | horizontal | No | Type of the progress bar, which cannot be changed dynamically. Available values are as follows:<br>- **horizontal**: linear progress bar.<br>- **circular**: loading progress bar.<br>- **ring**: ring progress bar.<br>- **scale-ring**: ring progress bar with a scale.<br>- **arc**: arc progress bar.<br>- **eclipse**<sup>5+</sup>: eclipse progress bar.|
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row6863121675218"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1751189523"><a name="p1751189523"></a><a name="p1751189523"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p17591819528"><a name="p17591819528"></a><a name="p17591819528"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p125151855212"><a name="p125151855212"></a><a name="p125151855212"></a>horizontal</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p14512188523"><a name="p14512188523"></a><a name="p14512188523"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1510182522"><a name="p1510182522"></a><a name="p1510182522"></a>Type of the progress bar, which cannot be changed dynamically. Available values are as follows:</p>
<a name="ul11541820527"></a><a name="ul11541820527"></a><ul id="ul11541820527"><li><strong id="b18309101417563"><a name="b18309101417563"></a><a name="b18309101417563"></a>horizontal</strong>: linear progress bar</li><li><strong id="b196571440135618"><a name="b196571440135618"></a><a name="b196571440135618"></a>circular</strong>: loading progress bar</li><li><strong id="b16931854165616"><a name="b16931854165616"></a><a name="b16931854165616"></a>ring</strong>: ring progress bar</li><li><strong id="b146913331714"><a name="b146913331714"></a><a name="b146913331714"></a>scale-ring</strong>: ring progress bar with a scale</li><li><strong id="b12958985218"><a name="b12958985218"></a><a name="b12958985218"></a>arc</strong>: arc progress bar</li><li><strong id="b3326182912218"><a name="b3326182912218"></a><a name="b3326182912218"></a>eclipse</strong><sup id="sup790255053720"><a name="sup790255053720"></a><a name="sup790255053720"></a>5+</sup>: eclipse progress bar</li></ul>
</td>
</tr>
</tbody>
</table>
Different types of progress bars support different attributes. Different types of progress bars support different attributes.
- When the type is **horizontal**, **ring**, or **scale-ring**, the following attributes are supported. - When the type is **horizontal**, **ring**, or **scale-ring**, the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
<a name="table2074230113515"></a> | ---------------- | ------ | ---- | ---- | ---------------- |
<table><thead align="left"><tr id="row1474313083519"><th class="cellrowborder" valign="top" width="23.52%" id="mcps1.1.6.1.1"><p id="p107434016350"><a name="p107434016350"></a><a name="p107434016350"></a>Name</p> | percent | number | 0 | No | Current progress. The value ranges from 0 to 100.|
</th> | secondarypercent | number | 0 | No | Secondary progress. The value ranges from 0 to 100.|
<th class="cellrowborder" valign="top" width="11.76%" id="mcps1.1.6.1.2"><p id="p37433017350"><a name="p37433017350"></a><a name="p37433017350"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="11.72%" id="mcps1.1.6.1.3"><p id="p1274316043517"><a name="p1274316043517"></a><a name="p1274316043517"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8%" id="mcps1.1.6.1.4"><p id="p37437033519"><a name="p37437033519"></a><a name="p37437033519"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="45%" id="mcps1.1.6.1.5"><p id="p174314073517"><a name="p174314073517"></a><a name="p174314073517"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row974313023514"><td class="cellrowborder" valign="top" width="23.52%" headers="mcps1.1.6.1.1 "><p id="p674313053511"><a name="p674313053511"></a><a name="p674313053511"></a>percent</p>
</td>
<td class="cellrowborder" valign="top" width="11.76%" headers="mcps1.1.6.1.2 "><p id="p16743708352"><a name="p16743708352"></a><a name="p16743708352"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="11.72%" headers="mcps1.1.6.1.3 "><p id="p157435053511"><a name="p157435053511"></a><a name="p157435053511"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8%" headers="mcps1.1.6.1.4 "><p id="p1374370133511"><a name="p1374370133511"></a><a name="p1374370133511"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.6.1.5 "><p id="p5743704359"><a name="p5743704359"></a><a name="p5743704359"></a>Current progress. The value ranges from 0 to 100.</p>
</td>
</tr>
<tr id="row16743104352"><td class="cellrowborder" valign="top" width="23.52%" headers="mcps1.1.6.1.1 "><p id="p1874313063517"><a name="p1874313063517"></a><a name="p1874313063517"></a>secondarypercent </p>
</td>
<td class="cellrowborder" valign="top" width="11.76%" headers="mcps1.1.6.1.2 "><p id="p127431015355"><a name="p127431015355"></a><a name="p127431015355"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="11.72%" headers="mcps1.1.6.1.3 "><p id="p1374317016354"><a name="p1374317016354"></a><a name="p1374317016354"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8%" headers="mcps1.1.6.1.4 "><p id="p774320103519"><a name="p774320103519"></a><a name="p774320103519"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.6.1.5 "><p id="p1974310173512"><a name="p1974310173512"></a><a name="p1974310173512"></a>Secondary progress. The value ranges from 0 to 100.</p>
</td>
</tr>
</tbody>
</table>
- When the type is **ring** or **scale-ring**, the following attributes are supported.
<a name="table2311759143520"></a>
<table><thead align="left"><tr id="row13121059163511"><th class="cellrowborder" valign="top" width="11%" id="mcps1.1.6.1.1"><p id="p6312155919354"><a name="p6312155919354"></a><a name="p6312155919354"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23%" id="mcps1.1.6.1.2"><p id="p73121259183512"><a name="p73121259183512"></a><a name="p73121259183512"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13%" id="mcps1.1.6.1.3"><p id="p1312359103512"><a name="p1312359103512"></a><a name="p1312359103512"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8%" id="mcps1.1.6.1.4"><p id="p20312175983514"><a name="p20312175983514"></a><a name="p20312175983514"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="45%" id="mcps1.1.6.1.5"><p id="p123121159113515"><a name="p123121159113515"></a><a name="p123121159113515"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row0312195911351"><td class="cellrowborder" valign="top" width="11%" headers="mcps1.1.6.1.1 "><p id="p43126599354"><a name="p43126599354"></a><a name="p43126599354"></a>clockwise </p>
</td>
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.1.6.1.2 "><p id="p11312659113520"><a name="p11312659113520"></a><a name="p11312659113520"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.1.6.1.3 "><p id="p6312359133511"><a name="p6312359133511"></a><a name="p6312359133511"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="8%" headers="mcps1.1.6.1.4 "><p id="p131218599350"><a name="p131218599350"></a><a name="p131218599350"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.6.1.5 "><p id="p12312175919356"><a name="p12312175919356"></a><a name="p12312175919356"></a>Whether the ring progress bar uses clockwise.</p>
</td>
</tr>
</tbody>
</table>
- When the type is **arc** or **eclipse**<sup>5+</sup>, the following attribute is supported.
<a name="table7731318123620"></a>
<table><thead align="left"><tr id="row107321518113612"><th class="cellrowborder" valign="top" width="23.52%" id="mcps1.1.6.1.1"><p id="p9732118103619"><a name="p9732118103619"></a><a name="p9732118103619"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="11.76%" id="mcps1.1.6.1.2"><p id="p107321618103616"><a name="p107321618103616"></a><a name="p107321618103616"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="11.72%" id="mcps1.1.6.1.3"><p id="p127321718173617"><a name="p127321718173617"></a><a name="p127321718173617"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8%" id="mcps1.1.6.1.4"><p id="p17321418153617"><a name="p17321418153617"></a><a name="p17321418153617"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="45%" id="mcps1.1.6.1.5"><p id="p573281814364"><a name="p573281814364"></a><a name="p573281814364"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1773251817366"><td class="cellrowborder" valign="top" width="23.52%" headers="mcps1.1.6.1.1 "><p id="p27322018143612"><a name="p27322018143612"></a><a name="p27322018143612"></a>percent</p>
</td>
<td class="cellrowborder" valign="top" width="11.76%" headers="mcps1.1.6.1.2 "><p id="p37321718113612"><a name="p37321718113612"></a><a name="p37321718113612"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="11.72%" headers="mcps1.1.6.1.3 "><p id="p12732171817366"><a name="p12732171817366"></a><a name="p12732171817366"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8%" headers="mcps1.1.6.1.4 "><p id="p8732101843613"><a name="p8732101843613"></a><a name="p8732101843613"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.6.1.5 "><p id="p14732318113613"><a name="p14732318113613"></a><a name="p14732318113613"></a>Current progress. The value ranges from 0 to 100.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
Horizontal progress bar, of which **type** is **horizontal**
<a name="t3c94bfbdec6f4ef08febb9d98feb69de"></a>
<table><thead align="left"><tr id="r53b2a254c9d645feb7260feb7770ab81"><th class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.1.6.1.1"><p id="a5d8aa9ff3111452b8d0de276c88b44b5"><a name="a5d8aa9ff3111452b8d0de276c88b44b5"></a><a name="a5d8aa9ff3111452b8d0de276c88b44b5"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="11.941194119411943%" id="mcps1.1.6.1.2"><p id="afca70efa86e8438ebc402dcba820a465"><a name="afca70efa86e8438ebc402dcba820a465"></a><a name="afca70efa86e8438ebc402dcba820a465"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="26.672667266726673%" id="mcps1.1.6.1.3"><p id="ae063aedcf344463b9e0c5b2363d9441a"><a name="ae063aedcf344463b9e0c5b2363d9441a"></a><a name="ae063aedcf344463b9e0c5b2363d9441a"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.9306930693069315%" id="mcps1.1.6.1.4"><p id="aba5cfe9b5b3c47ca890b6fca516a68d2"><a name="aba5cfe9b5b3c47ca890b6fca516a68d2"></a><a name="aba5cfe9b5b3c47ca890b6fca516a68d2"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="38.613861386138616%" id="mcps1.1.6.1.5"><p id="a91770a169ad44da99a22c882ce41bf86"><a name="a91770a169ad44da99a22c882ce41bf86"></a><a name="a91770a169ad44da99a22c882ce41bf86"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r8d7d69585da2411897bd21e25bdf945b"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="a76c0c59c9ef342648d24b3def45827d8"><a name="a76c0c59c9ef342648d24b3def45827d8"></a><a name="a76c0c59c9ef342648d24b3def45827d8"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="11.941194119411943%" headers="mcps1.1.6.1.2 "><p id="a7e7fc8b3939f4d8c8da8246c80ae85b8"><a name="a7e7fc8b3939f4d8c8da8246c80ae85b8"></a><a name="a7e7fc8b3939f4d8c8da8246c80ae85b8"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="26.672667266726673%" headers="mcps1.1.6.1.3 "><p id="p57261722152113"><a name="p57261722152113"></a><a name="p57261722152113"></a>#ff007dff</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="a45701b1485b44c0f97505e521710d4de"><a name="a45701b1485b44c0f97505e521710d4de"></a><a name="a45701b1485b44c0f97505e521710d4de"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="a5e442a4aedc84f0c95aa140a6ec8713c"><a name="a5e442a4aedc84f0c95aa140a6ec8713c"></a><a name="a5e442a4aedc84f0c95aa140a6ec8713c"></a>Color of the progress bar</p>
</td>
</tr>
<tr id="rfadd2e86d5a547398a318b82fe88ddcd"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="ae2d0777495164c409e85313fdf1c6a78"><a name="ae2d0777495164c409e85313fdf1c6a78"></a><a name="ae2d0777495164c409e85313fdf1c6a78"></a>stroke-width</p>
</td>
<td class="cellrowborder" valign="top" width="11.941194119411943%" headers="mcps1.1.6.1.2 "><p id="ab0e2ad53dc6545fab26a0dcaedafadcf"><a name="ab0e2ad53dc6545fab26a0dcaedafadcf"></a><a name="ab0e2ad53dc6545fab26a0dcaedafadcf"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="26.672667266726673%" headers="mcps1.1.6.1.3 "><p id="p163627544235"><a name="p163627544235"></a><a name="p163627544235"></a>4px</p>
<p id="p149261166381"><a name="p149261166381"></a><a name="p149261166381"></a></p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="a33f30b29f52e4f899dc0086815e1474c"><a name="a33f30b29f52e4f899dc0086815e1474c"></a><a name="a33f30b29f52e4f899dc0086815e1474c"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="acd7ffaee82cb4bfcb75c4b4c87dc512b"><a name="acd7ffaee82cb4bfcb75c4b4c87dc512b"></a><a name="acd7ffaee82cb4bfcb75c4b4c87dc512b"></a>Width of the progress bar</p>
</td>
</tr>
<tr id="row21738425241"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p02571753202620"><a name="p02571753202620"></a><a name="p02571753202620"></a>background-color </p>
</td>
<td class="cellrowborder" valign="top" width="11.941194119411943%" headers="mcps1.1.6.1.2 "><p id="p8257155332614"><a name="p8257155332614"></a><a name="p8257155332614"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="26.672667266726673%" headers="mcps1.1.6.1.3 "><p id="p1989061072811"><a name="p1989061072811"></a><a name="p1989061072811"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p82571153192611"><a name="p82571153192611"></a><a name="p82571153192611"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p106571314275"><a name="p106571314275"></a><a name="p106571314275"></a>Background color of the progress bar</p>
</td>
</tr>
<tr id="row517332532717"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p51731025172713"><a name="p51731025172713"></a><a name="p51731025172713"></a>secondary-color </p>
</td>
<td class="cellrowborder" valign="top" width="11.941194119411943%" headers="mcps1.1.6.1.2 "><p id="p1617322572712"><a name="p1617322572712"></a><a name="p1617322572712"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="26.672667266726673%" headers="mcps1.1.6.1.3 "><p id="p117332552710"><a name="p117332552710"></a><a name="p117332552710"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p1917315255277"><a name="p1917315255277"></a><a name="p1917315255277"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p2174122512271"><a name="p2174122512271"></a><a name="p2174122512271"></a>Color of the secondary progress bar</p>
</td>
</tr>
</tbody>
</table>
Circular progress bar \(**type** is **circular**\)
<a name="table1155720932812"></a>
<table><thead align="left"><tr id="row1655719918284"><th class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.1.6.1.1"><p id="p95572913285"><a name="p95572913285"></a><a name="p95572913285"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="11.881188118811883%" id="mcps1.1.6.1.2"><p id="p75579962816"><a name="p75579962816"></a><a name="p75579962816"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="26.732673267326728%" id="mcps1.1.6.1.3"><p id="p4557896289"><a name="p4557896289"></a><a name="p4557896289"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.9306930693069315%" id="mcps1.1.6.1.4"><p id="p75576914287"><a name="p75576914287"></a><a name="p75576914287"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="38.613861386138616%" id="mcps1.1.6.1.5"><p id="p1055711952815"><a name="p1055711952815"></a><a name="p1055711952815"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row755710910285"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p1055818912284"><a name="p1055818912284"></a><a name="p1055818912284"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="11.881188118811883%" headers="mcps1.1.6.1.2 "><p id="p115587942811"><a name="p115587942811"></a><a name="p115587942811"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="26.732673267326728%" headers="mcps1.1.6.1.3 "><p id="p14706141316531"><a name="p14706141316531"></a><a name="p14706141316531"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p05583932819"><a name="p05583932819"></a><a name="p05583932819"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p1955818992820"><a name="p1955818992820"></a><a name="p1955818992820"></a>Color of the dot on the loading progress bar</p>
</td>
</tr>
</tbody>
</table>
Ring or scale-ring progress bar \(**type** is **ring** or **scale-ring**\)
<a name="table1537513464181"></a>
<table><thead align="left"><tr id="row1237554618186"><th class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.1.6.1.1"><p id="p637584661816"><a name="p637584661816"></a><a name="p637584661816"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="24.152415241524153%" id="mcps1.1.6.1.2"><p id="p53751346191816"><a name="p53751346191816"></a><a name="p53751346191816"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="14.461446144614461%" id="mcps1.1.6.1.3"><p id="p183751046171811"><a name="p183751046171811"></a><a name="p183751046171811"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.9306930693069315%" id="mcps1.1.6.1.4"><p id="p173752046131812"><a name="p173752046131812"></a><a name="p173752046131812"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="38.613861386138616%" id="mcps1.1.6.1.5"><p id="p19375154617185"><a name="p19375154617185"></a><a name="p19375154617185"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1837534691818"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p3849195472110"><a name="p3849195472110"></a><a name="p3849195472110"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p14849205417213"><a name="p14849205417213"></a><a name="p14849205417213"></a>&lt;color&gt; | &lt;linear-gradient&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p48495548218"><a name="p48495548218"></a><a name="p48495548218"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p284914543213"><a name="p284914543213"></a><a name="p284914543213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p151721122192918"><a name="p151721122192918"></a><a name="p151721122192918"></a>Color of the ring progress bar. The <strong id="b724283216309"><a name="b724283216309"></a><a name="b724283216309"></a>ring</strong> type supports the linear gradient color.</p>
<div class="note" id="note11079430164"><a name="note11079430164"></a><a name="note11079430164"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1010744361610"><a name="p1010744361610"></a><a name="p1010744361610"></a>The linear gradient color supports only two color attribute formats, for example, <strong id="b1625485113015"><a name="b1625485113015"></a><a name="b1625485113015"></a>color = linear-gradient(#ff0000, #00ff00)</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row14416102211213"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p7850135412217"><a name="p7850135412217"></a><a name="p7850135412217"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p188504547217"><a name="p188504547217"></a><a name="p188504547217"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p128500549213"><a name="p128500549213"></a><a name="p128500549213"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p985015547217"><a name="p985015547217"></a><a name="p985015547217"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p1585014540215"><a name="p1585014540215"></a><a name="p1585014540215"></a>Background color of the ring progress bar.</p>
</td>
</tr>
<tr id="row1556129122116"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p178506545218"><a name="p178506545218"></a><a name="p178506545218"></a>secondary-color</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p14850185442115"><a name="p14850185442115"></a><a name="p14850185442115"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p1285012546213"><a name="p1285012546213"></a><a name="p1285012546213"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p6850654172116"><a name="p6850654172116"></a><a name="p6850654172116"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p16850115482113"><a name="p16850115482113"></a><a name="p16850115482113"></a>Color of the secondary ring progress bar.</p>
</td>
</tr>
<tr id="row109611629172118"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p639523362212"><a name="p639523362212"></a><a name="p639523362212"></a>stroke-width</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p1239520334229"><a name="p1239520334229"></a><a name="p1239520334229"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p1798517818391"><a name="p1798517818391"></a><a name="p1798517818391"></a>10px</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p839517333229"><a name="p839517333229"></a><a name="p839517333229"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p113951633172217"><a name="p113951633172217"></a><a name="p113951633172217"></a>Width of the ring progress bar.</p>
</td>
</tr>
<tr id="row6895103153610"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p2087515118365"><a name="p2087515118365"></a><a name="p2087515118365"></a>scale-width</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p14875181119368"><a name="p14875181119368"></a><a name="p14875181119368"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p7875141183616"><a name="p7875141183616"></a><a name="p7875141183616"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p68751411153613"><a name="p68751411153613"></a><a name="p68751411153613"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p5875211113612"><a name="p5875211113612"></a><a name="p5875211113612"></a>Scale thickness of the ring progress bar with a scale. This style takes effect only when the type is <strong id="b1286494621612"><a name="b1286494621612"></a><a name="b1286494621612"></a>scale-ring</strong>.</p>
</td>
</tr>
<tr id="row167446753610"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.1.6.1.1 "><p id="p1687516115364"><a name="p1687516115364"></a><a name="p1687516115364"></a>scale-number</p>
</td>
<td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.1.6.1.2 "><p id="p08765113363"><a name="p08765113363"></a><a name="p08765113363"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="14.461446144614461%" headers="mcps1.1.6.1.3 "><p id="p7876131133618"><a name="p7876131133618"></a><a name="p7876131133618"></a>120</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.1.6.1.4 "><p id="p7876711133618"><a name="p7876711133618"></a><a name="p7876711133618"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.1.6.1.5 "><p id="p1687671117364"><a name="p1687671117364"></a><a name="p1687671117364"></a>Number of scales of the ring progress bar with a scale. This style takes effect only when the type is <strong id="b155185320162"><a name="b155185320162"></a><a name="b155185320162"></a>scale-ring</strong>.</p>
</td>
</tr>
</tbody>
</table>
Arc progress bar, of which **type** is **arc**
<a name="table146111227294"></a>
<table><thead align="left"><tr id="row961102182918"><th class="cellrowborder" valign="top" width="20.842084208420843%" id="mcps1.1.6.1.1"><p id="p1561114219295"><a name="p1561114219295"></a><a name="p1561114219295"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.221222122212222%" id="mcps1.1.6.1.2"><p id="p1661116214291"><a name="p1661116214291"></a><a name="p1661116214291"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13.851385138513853%" id="mcps1.1.6.1.3"><p id="p86111628290"><a name="p86111628290"></a><a name="p86111628290"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="11.08110811081108%" id="mcps1.1.6.1.4"><p id="p126111820294"><a name="p126111820294"></a><a name="p126111820294"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="42.004200420042004%" id="mcps1.1.6.1.5"><p id="p16611172162919"><a name="p16611172162919"></a><a name="p16611172162919"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row161172152916"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p1732210516366"><a name="p1732210516366"></a><a name="p1732210516366"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p18322145153610"><a name="p18322145153610"></a><a name="p18322145153610"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p1389016133339"><a name="p1389016133339"></a><a name="p1389016133339"></a>-</p>
<p id="p23221751143616"><a name="p23221751143616"></a><a name="p23221751143616"></a></p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p432255116368"><a name="p432255116368"></a><a name="p432255116368"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p2322051193614"><a name="p2322051193614"></a><a name="p2322051193614"></a>Color of the arc progress bar.</p>
</td>
</tr>
<tr id="row615084732920"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p19233161103811"><a name="p19233161103811"></a><a name="p19233161103811"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p1223319112386"><a name="p1223319112386"></a><a name="p1223319112386"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p137148216342"><a name="p137148216342"></a><a name="p137148216342"></a>-</p>
<p id="p7233111133814"><a name="p7233111133814"></a><a name="p7233111133814"></a></p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p1723371143810"><a name="p1723371143810"></a><a name="p1723371143810"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p6233511381"><a name="p6233511381"></a><a name="p6233511381"></a>Background color of the arc progress bar.</p>
</td>
</tr>
<tr id="row142659209408"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p98738424715"><a name="p98738424715"></a><a name="p98738424715"></a>stroke-width</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p1687319424713"><a name="p1687319424713"></a><a name="p1687319424713"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p10840175014427"><a name="p10840175014427"></a><a name="p10840175014427"></a>4px</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p1873342671"><a name="p1873342671"></a><a name="p1873342671"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p188730421175"><a name="p188730421175"></a><a name="p188730421175"></a>Width of the arc progress bar.</p>
<div class="note" id="note1436241013318"><a name="note1436241013318"></a><a name="note1436241013318"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p43626101533"><a name="p43626101533"></a><a name="p43626101533"></a>The wider the progress bar is, the closer the progress bar is to the center of the circle. The progress bar is always within the radius.</p>
</div></div>
</td>
</tr>
<tr id="row1280652394013"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p1192581376"><a name="p1192581376"></a><a name="p1192581376"></a>start-angle</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p1719258277"><a name="p1719258277"></a><a name="p1719258277"></a>&lt;deg&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p320958271"><a name="p320958271"></a><a name="p320958271"></a>240</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p16203581878"><a name="p16203581878"></a><a name="p16203581878"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p112012582717"><a name="p112012582717"></a><a name="p112012582717"></a>Start angle of the arc progress bar, which starts from zero o'clock clockwise. The value ranges from 0 to 360 degrees.</p>
</td>
</tr>
<tr id="row16108193116405"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p204511458375"><a name="p204511458375"></a><a name="p204511458375"></a>total-angle</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p154521558371"><a name="p154521558371"></a><a name="p154521558371"></a>&lt;deg&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p74521558678"><a name="p74521558678"></a><a name="p74521558678"></a>240</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p14521158774"><a name="p14521158774"></a><a name="p14521158774"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p745211583716"><a name="p745211583716"></a><a name="p745211583716"></a>Total length of the arc progress bar. The value ranges from –360 to 360. A negative number indicates anticlockwise.</p>
</td>
</tr>
<tr id="row132153110406"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p2489145710819"><a name="p2489145710819"></a><a name="p2489145710819"></a>center-x</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p1378435564714"><a name="p1378435564714"></a><a name="p1378435564714"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p548911574817"><a name="p548911574817"></a><a name="p548911574817"></a>Half of the width of the arc progress bar</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p144897571081"><a name="p144897571081"></a><a name="p144897571081"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p154894570813"><a name="p154894570813"></a><a name="p154894570813"></a>Center of the arc progress bar (with the upper left corner of this widget as the coordinate origin). This style must be used together with <strong id="b10862143410196"><a name="b10862143410196"></a><a name="b10862143410196"></a>center-y</strong> and <strong id="b3868934121914"><a name="b3868934121914"></a><a name="b3868934121914"></a>radius</strong>.</p>
</td>
</tr>
<tr id="row1488143111409"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p1898218571884"><a name="p1898218571884"></a><a name="p1898218571884"></a>center-y</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p76431057204714"><a name="p76431057204714"></a><a name="p76431057204714"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p4982557182"><a name="p4982557182"></a><a name="p4982557182"></a>Half of the height of the arc progress bar</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p1982165710812"><a name="p1982165710812"></a><a name="p1982165710812"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p09827579819"><a name="p09827579819"></a><a name="p09827579819"></a>Center of the arc progress bar (with the upper left corner of this widget as the coordinate origin). This style must be used together with <strong id="b13704558131918"><a name="b13704558131918"></a><a name="b13704558131918"></a>center-x</strong> and <strong id="b1070995818199"><a name="b1070995818199"></a><a name="b1070995818199"></a>radius</strong>.</p>
</td>
</tr>
<tr id="row294916317406"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p1073135912815"><a name="p1073135912815"></a><a name="p1073135912815"></a>radius</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p6732759386"><a name="p6732759386"></a><a name="p6732759386"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p127321959086"><a name="p127321959086"></a><a name="p127321959086"></a>Half of the minimum width and height of the arc progress bar</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p197325591783"><a name="p197325591783"></a><a name="p197325591783"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p2732759982"><a name="p2732759982"></a><a name="p2732759982"></a>Radius of the arc progress bar. This style must be used together with <strong id="b14309114232012"><a name="b14309114232012"></a><a name="b14309114232012"></a>center-x</strong> and <strong id="b14474174412014"><a name="b14474174412014"></a><a name="b14474174412014"></a>center-y</strong>.</p>
</td>
</tr>
</tbody>
</table>
type=eclipse<sup>5+</sup>
<a name="table5191155852510"></a>
<table><thead align="left"><tr id="row119205815258"><th class="cellrowborder" valign="top" width="20.842084208420843%" id="mcps1.1.6.1.1"><p id="p1719211587252"><a name="p1719211587252"></a><a name="p1719211587252"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.221222122212222%" id="mcps1.1.6.1.2"><p id="p15192185817259"><a name="p15192185817259"></a><a name="p15192185817259"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13.851385138513853%" id="mcps1.1.6.1.3"><p id="p11192125852514"><a name="p11192125852514"></a><a name="p11192125852514"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="11.08110811081108%" id="mcps1.1.6.1.4"><p id="p16192155813256"><a name="p16192155813256"></a><a name="p16192155813256"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="42.004200420042004%" id="mcps1.1.6.1.5"><p id="p91921583256"><a name="p91921583256"></a><a name="p91921583256"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1819265882513"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p181923589254"><a name="p181923589254"></a><a name="p181923589254"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p11192258182515"><a name="p11192258182515"></a><a name="p11192258182515"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p519235819253"><a name="p519235819253"></a><a name="p519235819253"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p19192115802515"><a name="p19192115802515"></a><a name="p19192115802515"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p1019225811258"><a name="p1019225811258"></a><a name="p1019225811258"></a>Color of the eclipse progress bar.</p>
</td>
</tr>
<tr id="row11920586256"><td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.1.6.1.1 "><p id="p719210585259"><a name="p719210585259"></a><a name="p719210585259"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="12.221222122212222%" headers="mcps1.1.6.1.2 "><p id="p121920588253"><a name="p121920588253"></a><a name="p121920588253"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.851385138513853%" headers="mcps1.1.6.1.3 "><p id="p16193125814250"><a name="p16193125814250"></a><a name="p16193125814250"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="11.08110811081108%" headers="mcps1.1.6.1.4 "><p id="p4193115813254"><a name="p4193115813254"></a><a name="p4193115813254"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.004200420042004%" headers="mcps1.1.6.1.5 "><p id="p1319395813257"><a name="p1319395813257"></a><a name="p1319395813257"></a>Background color of the eclipse progress bar.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section16580153964314"></a>
Events in [Universal Events](js-components-common-events.md) are supported.
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section493033510346"></a>
``` - When the type is **ring** or **scale-ring**, the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| --------- | ------- | ---- | ---- | -------------- |
| clockwise | boolean | true | No | Whether the ring progress bar uses clockwise.|
- When the type is **arc** or **eclipse**<sup>5+</sup>, the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------- | ------ | ---- | ---- | ---------------- |
| percent | number | 0 | No | Current progress. The value ranges from 0 to 100.|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
Horizontal progress bar, of which **type** is **horizontal**
| Name | Type | Default Value | Mandatory | Description |
| ---------------- | -------------- | ---------- | ---- | ----------- |
| color | &lt;color&gt; | \#ff007dff | No | Color of the progress bar. |
| stroke-width | &lt;length&gt; | 4px | No | Stroke width of the progress bar. |
| background-color | &lt;color&gt; | - | No | Background color of the progress bar. |
| secondary-color | &lt;color&gt; | - | No | Color of the secondary progress bar.|
Circular progress bar, of which **type** is **circular**
| Name | Type | Default Value | Mandatory | Description |
| ----- | ------------- | ---- | ---- | ----------------- |
| color | &lt;color&gt; | - | No | Color of the dot on the loading progress bar.|
Ring or scale-ring progress bar, of which **ring** is **scale-ring**
| Name | Type | Default Value | Mandatory | Description |
| ---------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
| color | &lt;color&gt; \| &lt;linear-gradient&gt; | - | No | Color of the ring progress bar. The **ring** type supports the linear gradient color.<br>The linear gradient color supports only two color attribute formats, for example, **color = linear-gradient(\#ff0000, \#00ff00)**.|
| background-color | &lt;color&gt; | - | No | Background color of the ring progress bar. |
| secondary-color | &lt;color&gt; | - | No | Color of the secondary ring progress bar. |
| stroke-width | &lt;length&gt; | 10px | No | Width of the ring progress bar. |
| scale-width | &lt;length&gt; | - | No | Scale thickness of the ring progress bar with a scale. This style takes effect only when the type is **scale-ring**. |
| scale-number | number | 120 | No | Number of scales of the ring progress bar with a scale. This style takes effect only when the type is **scale-ring**. |
Arc progress bar, of which **type** is **arc**
| Name | Type | Default Value | Mandatory | Description |
| ---------------- | -------------- | ------------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | - | No | Color of the arc progress bar. |
| background-color | &lt;color&gt; | - | No | Background color of the arc progress bar. |
| stroke-width | &lt;length&gt; | 4px | No | Width of the arc progress bar, which is always within the radius area.<br>The wider the progress bar is, the closer the progress bar is to the center of the circle. The progress bar is always within the radius.|
| start-angle | &lt;deg&gt; | 240 | No | Start angle of the arc progress bar, which starts from zero o'clock clockwise. The value ranges from 0 to 360 degrees. |
| total-angle | &lt;deg&gt; | 240 | No | Total length of the arc progress bar. The value ranges from –360 to 360. A negative number indicates anticlockwise. |
| center-x | &lt;length&gt; | Half of the width of the arc progress bar | No | Center of the arc progress bar (with the upper left corner of the component as the coordinate origin). This style must be used together with **center-y** and **radius**.|
| center-y | &lt;length&gt; | Half of the height of the arc progress bar | No | Center of the arc progress bar (with the upper left corner of the component as the coordinate origin). This style must be used together with **center-x** and **radius**.|
| radius | &lt;length&gt; | Half of the minimum width and height of the arc progress bar| No | Radius of the arc progress bar. This style must be used together with **center-x** and **center-y**. |
Eclipse progress bar, of which **type** is **eclipse**<sup>5+</sup>
| Name | Type | Default Value | Mandatory | Description |
| ---------------- | ------------- | ---- | ---- | ---------- |
| color | &lt;color&gt; | - | No | Color of the eclipse progress bar. |
| background-color | &lt;color&gt; | - | No | Background color of the eclipse progress bar.|
## Events
The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!--xxx.hml --> <!--xxx.hml -->
<div class="container"> <div class="container">
<progress class="min-progress" type="scale-ring" percent= "10" secondarypercent="50"></progress> <progress class="min-progress" type="scale-ring" percent= "10" secondarypercent="50"></progress>
...@@ -495,7 +115,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -495,7 +115,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -509,5 +129,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -509,5 +129,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
![](figures/progress.png) ![progress](figures/progress.png)
# rating<a name="EN-US_TOPIC_0000001173324645"></a> # rating
The **<rating\>** component provides a rating bar used for reviews and ratings. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<rating>** component provides a rating bar used for reviews and ratings.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5141051050"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p157381413961"><a name="p157381413961"></a><a name="p157381413961"></a>numstars</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p973881313619"><a name="p973881313619"></a><a name="p973881313619"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1973871314616"><a name="p1973871314616"></a><a name="p1973871314616"></a>5</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p473891317617"><a name="p473891317617"></a><a name="p473891317617"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p173811138611"><a name="p173811138611"></a><a name="p173811138611"></a>Maximum number of rating stars.</p>
</td>
</tr>
<tr id="row11475954"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1973821316618"><a name="p1973821316618"></a><a name="p1973821316618"></a>rating</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p19738131320620"><a name="p19738131320620"></a><a name="p19738131320620"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p07386135610"><a name="p07386135610"></a><a name="p07386135610"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1673831319613"><a name="p1673831319613"></a><a name="p1673831319613"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p107382131366"><a name="p107382131366"></a><a name="p107382131366"></a>Current rating stars.</p>
</td>
</tr>
<tr id="row1372245811411"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p5738101319611"><a name="p5738101319611"></a><a name="p5738101319611"></a>stepsize</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p77381713261"><a name="p77381713261"></a><a name="p77381713261"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1073831312620"><a name="p1073831312620"></a><a name="p1073831312620"></a>0.5</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p5738613465"><a name="p5738613465"></a><a name="p5738613465"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p27381813364"><a name="p27381813364"></a><a name="p27381813364"></a>Step to increment the rating value.</p>
<div class="note" id="note1249472985312"><a name="note1249472985312"></a><a name="note1249472985312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p749462910531"><a name="p749462910531"></a><a name="p749462910531"></a></p>
</div></div>
</td>
</tr>
<tr id="row192599563412"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p16738813966"><a name="p16738813966"></a><a name="p16738813966"></a>indicator</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p47381313769"><a name="p47381313769"></a><a name="p47381313769"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1273815131861"><a name="p1273815131861"></a><a name="p1273815131861"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1073912131165"><a name="p1073912131165"></a><a name="p1073912131165"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p87391131166"><a name="p87391131166"></a><a name="p87391131166"></a>Whether to make the rating icons as an indicator (not-editable by users).</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table179091550174914"></a>
<table><thead align="left"><tr id="row1190955064913"><th class="cellrowborder" valign="top" width="20.71792820717928%" id="mcps1.1.6.1.1"><p id="p119091450154913"><a name="p119091450154913"></a><a name="p119091450154913"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.80791920807919%" id="mcps1.1.6.1.2"><p id="p390945020497"><a name="p390945020497"></a><a name="p390945020497"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.93890610938906%" id="mcps1.1.6.1.3"><p id="p2090917504493"><a name="p2090917504493"></a><a name="p2090917504493"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p189091750114910"><a name="p189091750114910"></a><a name="p189091750114910"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p79091750124917"><a name="p79091750124917"></a><a name="p79091750124917"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row17909450124912"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p790935084914"><a name="p790935084914"></a><a name="p790935084914"></a>star-background</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p129091350164920"><a name="p129091350164920"></a><a name="p129091350164920"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p99099503496"><a name="p99099503496"></a><a name="p99099503496"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1909125019497"><a name="p1909125019497"></a><a name="p1909125019497"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p79091050184910"><a name="p79091050184910"></a><a name="p79091050184910"></a>Background image when a rating star is unselected. Only PNG and JPG images in a local path are supported.</p>
</td>
</tr>
<tr id="row139092504495"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p19909185044919"><a name="p19909185044919"></a><a name="p19909185044919"></a>star-foreground</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p18909145064913"><a name="p18909145064913"></a><a name="p18909145064913"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p11909550204915"><a name="p11909550204915"></a><a name="p11909550204915"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p99101508497"><a name="p99101508497"></a><a name="p99101508497"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1091015502499"><a name="p1091015502499"></a><a name="p1091015502499"></a>Foreground image when a rating star is selected. Only PNG and JPG images in a local path are supported.</p>
</td>
</tr>
<tr id="row15910185012492"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p2910145018491"><a name="p2910145018491"></a><a name="p2910145018491"></a>star-secondary</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p16910145024916"><a name="p16910145024916"></a><a name="p16910145024916"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p7910125064915"><a name="p7910125064915"></a><a name="p7910125064915"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p8910150204910"><a name="p8910150204910"></a><a name="p8910150204910"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p391095015494"><a name="p391095015494"></a><a name="p391095015494"></a>Secondary background image when a rating star is partially selected. This image will cover the background image and can only be a PNG or JPG image from a local path.</p>
</td>
</tr>
<tr id="row12910155014493"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p7910135054915"><a name="p7910135054915"></a><a name="p7910135054915"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p69101950104910"><a name="p69101950104910"></a><a name="p69101950104910"></a>&lt;length&gt;|&lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p391015084913"><a name="p391015084913"></a><a name="p391015084913"></a>120 px</p>
<p id="p1391055012499"><a name="p1391055012499"></a><a name="p1391055012499"></a>60 px (cannot be edited)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p13910125064911"><a name="p13910125064911"></a><a name="p13910125064911"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1591035014911"><a name="p1591035014911"></a><a name="p1591035014911"></a>Image width. The default value is the width of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.</p>
</td>
</tr>
<tr id="row79101550124915"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p1591005054915"><a name="p1591005054915"></a><a name="p1591005054915"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p2091095024920"><a name="p2091095024920"></a><a name="p2091095024920"></a>&lt;length&gt;|&lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p20910155014915"><a name="p20910155014915"></a><a name="p20910155014915"></a>24px</p>
<p id="p29101650104920"><a name="p29101650104920"></a><a name="p29101650104920"></a>12 px (cannot be edited)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p491055024914"><a name="p491055024914"></a><a name="p491055024914"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1491065074910"><a name="p1491065074910"></a><a name="p1491065074910"></a>Image height. The default value is the height of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.</p>
</td>
</tr>
<tr id="row791012500491"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p29108504492"><a name="p29108504492"></a><a name="p29108504492"></a>rtl-flip</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p109107509490"><a name="p109107509490"></a><a name="p109107509490"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p391065018494"><a name="p391065018494"></a><a name="p391065018494"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1891015034920"><a name="p1891015034920"></a><a name="p1891015034920"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p391011508492"><a name="p391011508492"></a><a name="p391011508492"></a>Whether the image source is automatically flipped in the RTL text direction.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>You must set **star-background**, **star-secondary**, and **star-foreground**. Otherwise, the rating star is gray, indicating that the image is set incorrectly.
## Events<a name="section124498406719"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row518915212082"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p125587286811"><a name="p125587286811"></a><a name="p125587286811"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p255820281687"><a name="p255820281687"></a><a name="p255820281687"></a>{ rating: number }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p10558228886"><a name="p10558228886"></a><a name="p10558228886"></a>Triggered when the rating value changes.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section1715414253487"></a>
``` ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| numstars | number | 5 | No| Maximum number of rating stars.|
| rating | number | 0 | No| Number of stars rated.|
| stepsize | number | 0.5 | No| Step to increase the rating value.|
| indicator | boolean | false | No| Whether to make the rating icons as an indicator (not-editable by users).|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| star-background | string | - | No| Background image when a rating star is unselected. Only PNG and JPG images in a local path are supported.|
| star-foreground | string | - | No| Foreground image when a rating star is selected. Only PNG and JPG images in a local path are supported.|
| star-secondary | string | - | No| Secondary background image when a rating star is partially selected. This image will cover the background image and can only be a PNG or JPG image from a local path.|
| width | &lt;length&gt;\|&lt;percentage&gt; | 120px<br>60 px (cannot be edited)| No| Image width. The default value is the width of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.|
| height | &lt;length&gt;\|&lt;percentage&gt; | 24px<br>12px (cannot be edited)| No| Image height. The default value is the height of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.|
| rtl-flip | boolean | true | No| Whether the image source is automatically flipped in the RTL text direction.|
> **NOTE**
>
> You must set **star-background**, **star-secondary**, and **star-foreground**. Otherwise, the rating star is gray, indicating that the image is set incorrectly.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| change | { rating: number } | Triggered when the rating value changes.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<rating numstars="5" rating="5" @change="changeRating" id="rating"> <rating numstars="5" rating="5" @change="changeRating" id="rating">
...@@ -204,7 +71,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -204,7 +71,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -216,7 +83,7 @@ rating { ...@@ -216,7 +83,7 @@ rating {
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -228,5 +95,4 @@ export default { ...@@ -228,5 +95,4 @@ export default {
} }
``` ```
![](figures/1-6.png) ![1-6](figures/1-6.png)
# richtext<a name="EN-US_TOPIC_0000001173164701"></a> # richtext
The **<richtext\>** component displays rich text information.
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
>- The rich text content must be written in the content area. >
> - This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The rich text content must be written in the content area.
## Required Permissions<a name="section11257113618419"></a> The **\<richtext>** component displays rich text information.
## Required Permissions
None None
## Attributes<a name="section2907183951110"></a>
## Attributes
Only the **id**, **style**, and **class** attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
Only the **id**, **style**, and **class** attributes in [Universal Attributes](../arkui-js/js-components-common-attributes.md) are supported.
## Styles<a name="section5775351116"></a>
Only the **display** and** visibility** styles in [Universal Styles](js-components-common-styles.md) are supported. ## Styles
## Events<a name="section17878123517511"></a> Only the **display** and **visibility** styles in [Universal Styles](../arkui-js/js-components-common-styles.md) are supported.
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
## Events
<a name="table13878203565113"></a>
<table><thead align="left"><tr id="row18789355519"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p08781335165113"><a name="p08781335165113"></a><a name="p08781335165113"></a>Name</p> In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="p6878123595117"><a name="p6878123595117"></a><a name="p6878123595117"></a>Parameter</p> | Name| Parameter| Description|
</th> | -------- | -------- | -------- |
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="p28783359518"><a name="p28783359518"></a><a name="p28783359518"></a>Description</p> | start | - | Triggered when loading starts.|
</th> | complete | - | Triggered when the loading starts.|
</tr>
</thead> > **NOTE**
<tbody><tr id="row2087803565116"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p3878113518516"><a name="p3878113518516"></a><a name="p3878113518516"></a>start</p> > - The **focus**, **blur**, and **key** events are not supported.
</td> >
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p187813511516"><a name="p187813511516"></a><a name="p187813511516"></a>-</p> > - Accessibility events are not supported.
</td> >
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1269067752"><a name="p1269067752"></a><a name="p1269067752"></a>Triggered when the loading starts.</p> > - When a page containing **\<richtext>** is returned, the page's transition effect does not apply to the area where the rich text is displayed.
</td> >
</tr> > - Make sure the rich text does not go beyond the height of the screen. Otherwise, the excess content will not be displayed.
<tr id="row28781235145111"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p118810157518"><a name="p118810157518"></a><a name="p118810157518"></a>complete</p> >
</td> > - The width cannot be set. By default, the rich text is displayed in full screen.
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p19878535135111"><a name="p19878535135111"></a><a name="p19878535135111"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p13878335145119"><a name="p13878335145119"></a><a name="p13878335145119"></a>Triggered when the loading is complete.</p> ## Methods
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- The **focus**, **blur**, and **key** events are not supported.
>- Accessibility events are not supported.
>- When a page containing **<richtext\>** is returned, the page's transition effect does not apply to the area where the rich text is displayed.
>- Make sure the rich text does not go beyond the height of the screen. Otherwise, the excess content will not be displayed.
>- The width cannot be set. By default, the rich text is displayed in full screen.
## Methods<a name="section14703165113610"></a>
Not supported Not supported
## Example Code<a name="section581819591666"></a>
``` ## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="flex-direction: column;width: 100%;"> <div style="flex-direction: column;width: 100%;">
<richtext @start="onLoadStart" @complete="onLoadEnd">{{content}}</richtext> <richtext @start="onLoadStart" @complete="onLoadEnd">{{content}}</richtext>
</div> </div>
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -75,9 +67,9 @@ export default { ...@@ -75,9 +67,9 @@ export default {
<div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;" style="background-color: #FFFFFF"> <div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;" style="background-color: #FFFFFF">
<style>h1{color: yellow;}</style> <style>h1{color: yellow;}</style>
<p class="item-title">h1</p> <p class="item-title">h1</p>
<h1>Text test (H1 test)</h1> <h1>Text test (h1 test)</h1>
<p class="item-title">h2</p> <p class="item-title">h2</p>
<h2>Text test (H2 test)</h2> <h2>Text test (h2 test)</h2>
</div> </div>
`, `,
}, },
...@@ -89,4 +81,3 @@ export default { ...@@ -89,4 +81,3 @@ export default {
} }
} }
``` ```
# search<a name="EN-US_TOPIC_0000001173164773"></a> # search
The **<search\>** component provides an input area for users to search. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Child Components<a name="section9288143101012"></a> The **\<Search>** component provides an input area for users to search.
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
<a name="table20633101642315"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row16500184513188"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19823174614180"><a name="p19823174614180"></a><a name="p19823174614180"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3823184617189"><a name="p3823184617189"></a><a name="p3823184617189"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9823946181811"><a name="p9823946181811"></a><a name="p9823946181811"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1782334621813"><a name="p1782334621813"></a><a name="p1782334621813"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p082364616188"><a name="p082364616188"></a><a name="p082364616188"></a>Search icon. By default, the system search icon is used. The supported icon format is SVG, JPG, and PNG.</p>
</td>
</tr>
<tr id="row517994310189"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1782314611185"><a name="p1782314611185"></a><a name="p1782314611185"></a>hint</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6823164617184"><a name="p6823164617184"></a><a name="p6823164617184"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p282314617188"><a name="p282314617188"></a><a name="p282314617188"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p198231046181817"><a name="p198231046181817"></a><a name="p198231046181817"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1823846131819"><a name="p1823846131819"></a><a name="p1823846131819"></a>Hint text.</p>
</td>
</tr>
<tr id="row19730640181819"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p482374611185"><a name="p482374611185"></a><a name="p482374611185"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1082315461186"><a name="p1082315461186"></a><a name="p1082315461186"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1282384613182"><a name="p1282384613182"></a><a name="p1282384613182"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p18823154617189"><a name="p18823154617189"></a><a name="p18823154617189"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p208241446121810"><a name="p208241446121810"></a><a name="p208241446121810"></a>Text in the search box.</p>
</td>
</tr>
<tr id="row83561013112217"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p735651316223"><a name="p735651316223"></a><a name="p735651316223"></a>searchbutton<sup id="sup46781354122715"><a name="sup46781354122715"></a><a name="sup46781354122715"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1356213172219"><a name="p1356213172219"></a><a name="p1356213172219"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p6356713182219"><a name="p6356713182219"></a><a name="p6356713182219"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p13564131227"><a name="p13564131227"></a><a name="p13564131227"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p4356131312222"><a name="p4356131312222"></a><a name="p4356131312222"></a>Text on the search button at the end of the search box.</p>
</td>
</tr>
<tr id="row31984911281"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p177221571244"><a name="p177221571244"></a><a name="p177221571244"></a>menuoptions<sup id="sup154944401542"><a name="sup154944401542"></a><a name="sup154944401542"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p8722157248"><a name="p8722157248"></a><a name="p8722157248"></a>Array&lt;<a href="#table83621954963">MenuOption</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p167221878414"><a name="p167221878414"></a><a name="p167221878414"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p197227713411"><a name="p197227713411"></a><a name="p197227713411"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p207221573417"><a name="p207221573417"></a><a name="p207221573417"></a>Menu options displayed after users click the <strong id="b21781315182119"><a name="b21781315182119"></a><a name="b21781315182119"></a>More</strong> button in the pop menu.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** MenuOption<sup>5+</sup> | Name | Type | Default Value | Mandatory | Description |
| ------------------------- | ----------------------- | ---- | ---- | --------------------------------- |
| icon | string | - | No | Search icon. By default, the system search icon is used. The supported icon format is SVG, JPG, and PNG.|
| hint | string | - | No | Hint text. |
| value | string | - | No | Text in the search box. |
| searchbutton<sup>5+</sup> | string | - | No | Text on the search button at the end of the search box. |
| menuoptions<sup>5+</sup> | Array&lt;MenuOption&gt; | - | No | Menu options displayed after users click the **More** button. |
<a name="table83621954963"></a> **Table 1** MenuOption<sup>5+</sup>
<table><thead align="left"><tr id="row536212545619"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p143621541967"><a name="p143621541967"></a><a name="p143621541967"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p936215541620"><a name="p936215541620"></a><a name="p936215541620"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p23626541665"><a name="p23626541665"></a><a name="p23626541665"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5362254461"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p33631541265"><a name="p33631541265"></a><a name="p33631541265"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p536311543619"><a name="p536311543619"></a><a name="p536311543619"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p73631954762"><a name="p73631954762"></a><a name="p73631954762"></a>Path of the icon for a menu option.</p>
</td>
</tr>
<tr id="row136319547613"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p12363654367"><a name="p12363654367"></a><a name="p12363654367"></a>content</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p1936312549617"><a name="p1936312549617"></a><a name="p1936312549617"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1036311548616"><a name="p1036311548616"></a><a name="p1036311548616"></a>Text content in a menu option.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a> | Name | Type | Description |
| ------- | ------ | ----------- |
| icon | string | Path of the icon for a menu option.|
| content | string | Text content of a menu option.|
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table14588121079"></a> ## Styles
<table><thead align="left"><tr id="row3588182975"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p2588112873"><a name="p2588112873"></a><a name="p2588112873"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="14.1985801419858%" id="mcps1.1.6.1.2"><p id="p18588321876"><a name="p18588321876"></a><a name="p18588321876"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="20.247975202479754%" id="mcps1.1.6.1.3"><p id="p1588132673"><a name="p1588132673"></a><a name="p1588132673"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="5.23947605239476%" id="mcps1.1.6.1.4"><p id="p3588192276"><a name="p3588192276"></a><a name="p3588192276"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="37.1962803719628%" id="mcps1.1.6.1.5"><p id="p55881121575"><a name="p55881121575"></a><a name="p55881121575"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row45881726713"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1588182874"><a name="p1588182874"></a><a name="p1588182874"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p8588725714"><a name="p8588725714"></a><a name="p8588725714"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p13588521677"><a name="p13588521677"></a><a name="p13588521677"></a>#e6000000</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p11588112272"><a name="p11588112272"></a><a name="p11588112272"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p17588923718"><a name="p17588923718"></a><a name="p17588923718"></a>Font color of the search box.</p>
</td>
</tr>
<tr id="row858822573"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p25881521973"><a name="p25881521973"></a><a name="p25881521973"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p13588629717"><a name="p13588629717"></a><a name="p13588629717"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p15588321719"><a name="p15588321719"></a><a name="p15588321719"></a>16px</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p05899216712"><a name="p05899216712"></a><a name="p05899216712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p175891621973"><a name="p175891621973"></a><a name="p175891621973"></a>Font size of the search box.</p>
</td>
</tr>
<tr id="row14589724712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p155891921078"><a name="p155891921078"></a><a name="p155891921078"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p658922277"><a name="p658922277"></a><a name="p658922277"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p12589521713"><a name="p12589521713"></a><a name="p12589521713"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p155891121872"><a name="p155891121872"></a><a name="p155891121872"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p55894219719"><a name="p55894219719"></a><a name="p55894219719"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note13589162372"><a name="note13589162372"></a><a name="note13589162372"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p12589021175"><a name="p12589021175"></a><a name="p12589021175"></a>If the <strong id="b740874017101"><a name="b740874017101"></a><a name="b740874017101"></a>config-changes</strong> tag of <strong id="b12415940161018"><a name="b12415940161018"></a><a name="b12415940161018"></a>fontSize</strong> is configured for abilities in the <strong id="b1415740131016"><a name="b1415740131016"></a><a name="b1415740131016"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="row3589121375"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p95891321170"><a name="p95891321170"></a><a name="p95891321170"></a>placeholder-color</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p1058982376"><a name="p1058982376"></a><a name="p1058982376"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p9589726718"><a name="p9589726718"></a><a name="p9589726718"></a>#99000000</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p558914219710"><a name="p558914219710"></a><a name="p558914219710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p25896215710"><a name="p25896215710"></a><a name="p25896215710"></a>Color of the hint text.</p>
</td>
</tr>
<tr id="row1658911216712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p4589182976"><a name="p4589182976"></a><a name="p4589182976"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p18589122578"><a name="p18589122578"></a><a name="p18589122578"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p1058982179"><a name="p1058982179"></a><a name="p1058982179"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p1058917212710"><a name="p1058917212710"></a><a name="p1058917212710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p2058912778"><a name="p2058912778"></a><a name="p2058912778"></a>Font weight. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b126119204152"><a name="b126119204152"></a><a name="b126119204152"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row45906217712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p115907212715"><a name="p115907212715"></a><a name="p115907212715"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p459015215711"><a name="p459015215711"></a><a name="p459015215711"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p4590172674"><a name="p4590172674"></a><a name="p4590172674"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p12590828720"><a name="p12590828720"></a><a name="p12590828720"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p17590721579"><a name="p17590721579"></a><a name="p17590721579"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> in the family is selected as the font for the text. </p>
</td>
</tr>
<tr id="row583415126314"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p153521247133716"><a name="p153521247133716"></a><a name="p153521247133716"></a>caret-color<sup id="sup535294718377"><a name="sup535294718377"></a><a name="sup535294718377"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p53529471377"><a name="p53529471377"></a><a name="p53529471377"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p235244716372"><a name="p235244716372"></a><a name="p235244716372"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p4352174712375"><a name="p4352174712375"></a><a name="p4352174712375"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p1935320474379"><a name="p1935320474379"></a><a name="p1935320474379"></a>Color of the input cursor.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section17878123517511"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. | Name | Type | Default Value | Mandatory | Description |
| ------------------------ | -------------------------- | --------------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | \#e6000000 | No | Font color of the search box. |
| font-size | &lt;length&gt; | 16px | No | Font size of the search box. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| placeholder-color | &lt;color&gt; | \#99000000<br>| No | Color of the hint text. |
| font-weight | number \| string | normal | No | Font weight. For details, see **font-weight** of the **[\<text>](../arkui-js/js-components-basic-text.md#styles)** component.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| caret-color<sup>6+</sup> | &lt;color&gt; | - | No | Color of the caret. |
<a name="table13878203565113"></a>
<table><thead align="left"><tr id="row18789355519"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p08781335165113"><a name="p08781335165113"></a><a name="p08781335165113"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="p6878123595117"><a name="p6878123595117"></a><a name="p6878123595117"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="p28783359518"><a name="p28783359518"></a><a name="p28783359518"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row2087803565116"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p3878113518516"><a name="p3878113518516"></a><a name="p3878113518516"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p187813511516"><a name="p187813511516"></a><a name="p187813511516"></a>{ text:newText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p19878133518518"><a name="p19878133518518"></a><a name="p19878133518518"></a>Triggered when the content entered in the text box changes.</p>
<div class="note" id="note887893525112"><a name="note887893525112"></a><a name="note887893525112"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p19878435115119"><a name="p19878435115119"></a><a name="p19878435115119"></a>If you change the <strong id="b1292019401570"><a name="b1292019401570"></a><a name="b1292019401570"></a>value</strong> attribute directly, this event will not be triggered.</p>
</div></div>
</td>
</tr>
<tr id="row28781235145111"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p48781535195110"><a name="p48781535195110"></a><a name="p48781535195110"></a>submit</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p19878535135111"><a name="p19878535135111"></a><a name="p19878535135111"></a>{ text:submitText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p13878335145119"><a name="p13878335145119"></a><a name="p13878335145119"></a>Triggered when users click the search icon or the search button<sup id="sup790816581014"><a name="sup790816581014"></a><a name="sup790816581014"></a>5+</sup>, or tap the search button on a soft keyboard.</p>
</td>
</tr>
<tr id="row108791535175110"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p118790355519"><a name="p118790355519"></a><a name="p118790355519"></a>translate<sup id="sup18879203525118"><a name="sup18879203525118"></a><a name="sup18879203525118"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p9879113511519"><a name="p9879113511519"></a><a name="p9879113511519"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p08797356513"><a name="p08797356513"></a><a name="p08797356513"></a>Triggered when users click the translate button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row68791835175117"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p12879135135120"><a name="p12879135135120"></a><a name="p12879135135120"></a>share<sup id="sup3879173513515"><a name="sup3879173513515"></a><a name="sup3879173513515"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p5879153595110"><a name="p5879153595110"></a><a name="p5879153595110"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p15879183520514"><a name="p15879183520514"></a><a name="p15879183520514"></a>Triggered when users click the share button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row1287912352517"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p198791035125112"><a name="p198791035125112"></a><a name="p198791035125112"></a>search<sup id="sup1487914358515"><a name="sup1487914358515"></a><a name="sup1487914358515"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p9879735125114"><a name="p9879735125114"></a><a name="p9879735125114"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p38791935135119"><a name="p38791935135119"></a><a name="p38791935135119"></a>Triggered when users click the search button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row14879335145120"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p98790359512"><a name="p98790359512"></a><a name="p98790359512"></a>optionselect<sup id="sup28791635145111"><a name="sup28791635145111"></a><a name="sup28791635145111"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p158791235115114"><a name="p158791235115114"></a><a name="p158791235115114"></a>{ index:optionIndex, value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1087917353518"><a name="p1087917353518"></a><a name="p1087917353518"></a>Triggered when users click a menu option in the pop menu displayed after they select a text segment. This event is valid only when the <strong id="b192388148166"><a name="b192388148166"></a><a name="b192388148166"></a>menuoptions</strong> attribute is set. The option index and selected text content are returned.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a> ## Events
Methods in [Universal Methods](js-components-common-methods.md) are supported. In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
## Example Code<a name="section586520905216"></a> | Name | Parameter | Description |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
| change | { text:newText } | Triggered when the content entered in the text box changes.<br>If you change the **value** attribute directly, this event will not be triggered. |
| submit | { text:submitText } | Triggered when users click the search icon or the search button<sup>5+</sup>, or tap the search button on a soft keyboard. |
| translate<sup>5+</sup> | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned.|
| share<sup>5+</sup> | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned.|
| search<sup>5+</sup> | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned.|
| optionselect<sup>5+</sup> | { index:optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned.|
```
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<search hint="Enter keywords" searchbutton="Search" @search="search"> <search hint="Enter keywords" searchbutton="Search" @search="search">
</search> </search>
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -291,5 +85,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -291,5 +85,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
![](figures/en-us_image_0000001153427082.png) ![en-us_image_0000001153427082](figures/en-us_image_0000001153427082.png)
# slider<a name="EN-US_TOPIC_0000001127125056"></a> # slider
The **<slider\>** component is used to quickly adjust settings, such as volume and brightness. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Child Component<a name="section9288143101012"></a> The **\<Slider>** component is used to quickly adjust settings, such as the volume and brightness.
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
<a name="table20633101642315"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row16974649114813"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p742485124819"><a name="p742485124819"></a><a name="p742485124819"></a>min</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p742465115481"><a name="p742465115481"></a><a name="p742465115481"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p144241151104815"><a name="p144241151104815"></a><a name="p144241151104815"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p15424751104814"><a name="p15424751104814"></a><a name="p15424751104814"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p14241451144812"><a name="p14241451144812"></a><a name="p14241451144812"></a>Minimum value of the slider.</p>
</td>
</tr>
<tr id="row497424913485"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p0424205134814"><a name="p0424205134814"></a><a name="p0424205134814"></a>max</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p10424155114487"><a name="p10424155114487"></a><a name="p10424155114487"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p942412519487"><a name="p942412519487"></a><a name="p942412519487"></a>100</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p12424115118483"><a name="p12424115118483"></a><a name="p12424115118483"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1842435134811"><a name="p1842435134811"></a><a name="p1842435134811"></a>Maximum value of the slider.</p>
</td>
</tr>
<tr id="row297464984810"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1042425184815"><a name="p1042425184815"></a><a name="p1042425184815"></a>step</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1342410513489"><a name="p1342410513489"></a><a name="p1342410513489"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p154248512485"><a name="p154248512485"></a><a name="p154248512485"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p94251151174812"><a name="p94251151174812"></a><a name="p94251151174812"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p134251351194814"><a name="p134251351194814"></a><a name="p134251351194814"></a>Step of each slide.</p>
</td>
</tr>
<tr id="row736464410486"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p144258513482"><a name="p144258513482"></a><a name="p144258513482"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p134259510484"><a name="p134259510484"></a><a name="p134259510484"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p114257517483"><a name="p114257517483"></a><a name="p114257517483"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p64251851154813"><a name="p64251851154813"></a><a name="p64251851154813"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p442565119483"><a name="p442565119483"></a><a name="p442565119483"></a>Initial value of the slider.</p>
</td>
</tr>
<tr id="row465682516521"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p123951732185210"><a name="p123951732185210"></a><a name="p123951732185210"></a>mode<sup id="sup59311418187"><a name="sup59311418187"></a><a name="sup59311418187"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p0395183220521"><a name="p0395183220521"></a><a name="p0395183220521"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1639518325526"><a name="p1639518325526"></a><a name="p1639518325526"></a>outset</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p23951632105213"><a name="p23951632105213"></a><a name="p23951632105213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p83958323527"><a name="p83958323527"></a><a name="p83958323527"></a>Slider style. Available values are as follows:</p>
<a name="ul742810911538"></a><a name="ul742810911538"></a><ul id="ul742810911538"><li><strong id="b6310165918435"><a name="b6310165918435"></a><a name="b6310165918435"></a>outset</strong>: The slider is on the sliding bar.</li><li><strong id="b144297112440"><a name="b144297112440"></a><a name="b144297112440"></a>inset</strong>: The slider is inside the sliding bar.<div class="note" id="note10509152215419"><a name="note10509152215419"></a><a name="note10509152215419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p14509172218549"><a name="p14509172218549"></a><a name="p14509172218549"></a></p>
</div></div>
</li></ul>
</td>
</tr>
<tr id="row355472075219"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p339523215218"><a name="p339523215218"></a><a name="p339523215218"></a>showsteps<sup id="sup11798124781817"><a name="sup11798124781817"></a><a name="sup11798124781817"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p193951032185216"><a name="p193951032185216"></a><a name="p193951032185216"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p12395153214526"><a name="p12395153214526"></a><a name="p12395153214526"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1139593235218"><a name="p1139593235218"></a><a name="p1139593235218"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p639683265217"><a name="p639683265217"></a><a name="p639683265217"></a>Whether to display slider scales.</p>
<div class="note" id="note8765635135413"><a name="note8765635135413"></a><a name="note8765635135413"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p576523535418"><a name="p576523535418"></a><a name="p576523535418"></a></p>
</div></div>
</td>
</tr>
<tr id="row1711814164526"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p10396232195214"><a name="p10396232195214"></a><a name="p10396232195214"></a>showtips<sup id="sup14957135010188"><a name="sup14957135010188"></a><a name="sup14957135010188"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6396832185213"><a name="p6396832185213"></a><a name="p6396832185213"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p8396132205215"><a name="p8396132205215"></a><a name="p8396132205215"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p123962032185210"><a name="p123962032185210"></a><a name="p123962032185210"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p16396133212520"><a name="p16396133212520"></a><a name="p16396133212520"></a>Whether a pop-up is displayed to show the percentage value on the slider.</p>
<div class="note" id="note0708645135419"><a name="note0708645135419"></a><a name="note0708645135419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p4708154510548"><a name="p4708154510548"></a><a name="p4708154510548"></a></p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a> | Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| min | number | 0 | No| Minimum value of the slider.|
| max | number | 100 | No| Maximum value of the slider.|
| step | number | 1 | No| Step of each slide.|
| value | number | 0 | No| Initial value of the slider.|
| mode<sup>5+</sup> | string | outset | No| Slider style. Available values are as follows:<br>- **outset**: The slider is on the sliding bar.<br>- **inset**: The slider is inside the sliding bar.|
| showsteps<sup>5+</sup> | boolean | false | No| Whether to display slider scales.|
| showtips<sup>5+</sup> | boolean | false | No| Whether a tooltip is displayed to show the percentage value on the slider.|
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table1196916173572"></a> ## Styles
<table><thead align="left"><tr id="row15969161714572"><th class="cellrowborder" valign="top" width="17.688231176882315%" id="mcps1.1.6.1.1"><p id="p99691317115713"><a name="p99691317115713"></a><a name="p99691317115713"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="10.588941105889413%" id="mcps1.1.6.1.2"><p id="p1969141715570"><a name="p1969141715570"></a><a name="p1969141715570"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="24.18758124187582%" id="mcps1.1.6.1.3"><p id="p9969317105718"><a name="p9969317105718"></a><a name="p9969317105718"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="15.578442155784424%" id="mcps1.1.6.1.4"><p id="p12969517115717"><a name="p12969517115717"></a><a name="p12969517115717"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="31.95680431956805%" id="mcps1.1.6.1.5"><p id="p2969717175713"><a name="p2969717175713"></a><a name="p2969717175713"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row179691817175713"><td class="cellrowborder" valign="top" width="17.688231176882315%" headers="mcps1.1.6.1.1 "><p id="p796919179575"><a name="p796919179575"></a><a name="p796919179575"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="10.588941105889413%" headers="mcps1.1.6.1.2 "><p id="p119699173572"><a name="p119699173572"></a><a name="p119699173572"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="24.18758124187582%" headers="mcps1.1.6.1.3 "><p id="p796911714579"><a name="p796911714579"></a><a name="p796911714579"></a>#19000000</p>
</td>
<td class="cellrowborder" valign="top" width="15.578442155784424%" headers="mcps1.1.6.1.4 "><p id="p169699176574"><a name="p169699176574"></a><a name="p169699176574"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="31.95680431956805%" headers="mcps1.1.6.1.5 "><p id="p696910177571"><a name="p696910177571"></a><a name="p696910177571"></a>Background color of the slider.</p>
</td>
</tr>
<tr id="row179698172574"><td class="cellrowborder" valign="top" width="17.688231176882315%" headers="mcps1.1.6.1.1 "><p id="p12969717115711"><a name="p12969717115711"></a><a name="p12969717115711"></a>selected-color</p>
</td>
<td class="cellrowborder" valign="top" width="10.588941105889413%" headers="mcps1.1.6.1.2 "><p id="p13970121719579"><a name="p13970121719579"></a><a name="p13970121719579"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="24.18758124187582%" headers="mcps1.1.6.1.3 "><p id="p89701917165714"><a name="p89701917165714"></a><a name="p89701917165714"></a>#ff007dff</p>
</td>
<td class="cellrowborder" valign="top" width="15.578442155784424%" headers="mcps1.1.6.1.4 "><p id="p8970161713572"><a name="p8970161713572"></a><a name="p8970161713572"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="31.95680431956805%" headers="mcps1.1.6.1.5 "><p id="p1097011173571"><a name="p1097011173571"></a><a name="p1097011173571"></a>Selected color of the slider.</p>
</td>
</tr>
<tr id="row6970181735714"><td class="cellrowborder" valign="top" width="17.688231176882315%" headers="mcps1.1.6.1.1 "><p id="p1970141717579"><a name="p1970141717579"></a><a name="p1970141717579"></a>block-color</p>
</td>
<td class="cellrowborder" valign="top" width="10.588941105889413%" headers="mcps1.1.6.1.2 "><p id="p4970617165718"><a name="p4970617165718"></a><a name="p4970617165718"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="24.18758124187582%" headers="mcps1.1.6.1.3 "><p id="p297091755720"><a name="p297091755720"></a><a name="p297091755720"></a>#ffffff</p>
</td>
<td class="cellrowborder" valign="top" width="15.578442155784424%" headers="mcps1.1.6.1.4 "><p id="p3970121745715"><a name="p3970121745715"></a><a name="p3970121745715"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="31.95680431956805%" headers="mcps1.1.6.1.5 "><p id="p12970817175710"><a name="p12970817175710"></a><a name="p12970817175710"></a>Slider color.</p>
<div class="note" id="note29562075516"><a name="note29562075516"></a><a name="note29562075516"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p7956203555"><a name="p7956203555"></a><a name="p7956203555"></a></p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Events<a name="section412849105010"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. | Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| color | &lt;color&gt; | #19000000 | No| Background color of the slider.|
| selected-color | &lt;color&gt; | #ff007dff | No| Selected color of the slider.|
| block-color | &lt;color&gt; | \#ffffff | No| Slider color.|
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.452945294529453%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.69456945694569%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row4467111418517"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p5786131515111"><a name="p5786131515111"></a><a name="p5786131515111"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.452945294529453%" headers="mcps1.1.4.1.2 "><p id="p145081649105418"><a name="p145081649105418"></a><a name="p145081649105418"></a><a href="#table12318174214516">ChangeEvent</a></p>
</td>
<td class="cellrowborder" valign="top" width="45.69456945694569%" headers="mcps1.1.4.1.3 "><p id="p078614157518"><a name="p078614157518"></a><a name="p078614157518"></a>Triggered when the value changes.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** ChangeEvent ## Events
<a name="table12318174214516"></a> In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
<table><thead align="left"><tr id="row631810427458"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="a82b31036c9c94b3d8a7702523f9b40ec"><a name="a82b31036c9c94b3d8a7702523f9b40ec"></a><a name="a82b31036c9c94b3d8a7702523f9b40ec"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="a916c9aa3c32e4903953063bb7424027c"><a name="a916c9aa3c32e4903953063bb7424027c"></a><a name="a916c9aa3c32e4903953063bb7424027c"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="af9aad173dc2f44f5be69c86fe5537af7"><a name="af9aad173dc2f44f5be69c86fe5537af7"></a><a name="af9aad173dc2f44f5be69c86fe5537af7"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1731934264512"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="a660dbbfaf8d349b7921fbe9a0b96574a"><a name="a660dbbfaf8d349b7921fbe9a0b96574a"></a><a name="a660dbbfaf8d349b7921fbe9a0b96574a"></a>progress(deprecated<sup id="sup119388266511"><a name="sup119388266511"></a><a name="sup119388266511"></a>5+</sup>)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="aab0506a4edc147beb25866891e5fddcd"><a name="aab0506a4edc147beb25866891e5fddcd"></a><a name="aab0506a4edc147beb25866891e5fddcd"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="aa3d09d0a55704a6097fb39739436c5db"><a name="aa3d09d0a55704a6097fb39739436c5db"></a><a name="aa3d09d0a55704a6097fb39739436c5db"></a>Current value of the slider.</p>
</td>
</tr>
<tr id="row1595014195562"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1951151935610"><a name="p1951151935610"></a><a name="p1951151935610"></a>isEnd(deprecated<sup id="sup99714213583"><a name="sup99714213583"></a><a name="sup99714213583"></a>5+</sup>)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p89511819125613"><a name="p89511819125613"></a><a name="p89511819125613"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p129511219115620"><a name="p129511219115620"></a><a name="p129511219115620"></a>Whether the dragging operation ends. Available values are as follows:</p>
<a name="ul1332217234581"></a><a name="ul1332217234581"></a><ul id="ul1332217234581"><li><strong id="b184858101968"><a name="b184858101968"></a><a name="b184858101968"></a>true</strong>: The dragging ends.</li><li><strong id="b1099042014618"><a name="b1099042014618"></a><a name="b1099042014618"></a>false</strong>: The dragging is in progress.</li></ul>
</td>
</tr>
<tr id="row68961248174517"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="a7e263f0434c94a16a584943ddde92012"><a name="a7e263f0434c94a16a584943ddde92012"></a><a name="a7e263f0434c94a16a584943ddde92012"></a>value<sup id="sup11254165405316"><a name="sup11254165405316"></a><a name="sup11254165405316"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="a76ffd0f779234ab6a77e808500fca675"><a name="a76ffd0f779234ab6a77e808500fca675"></a><a name="a76ffd0f779234ab6a77e808500fca675"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="a85eddf1d320641a8b344aaadffe6d49e"><a name="a85eddf1d320641a8b344aaadffe6d49e"></a><a name="a85eddf1d320641a8b344aaadffe6d49e"></a>Current value of the slider.</p>
</td>
</tr>
<tr id="row1333335416456"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p733395494510"><a name="p733395494510"></a><a name="p733395494510"></a>mode<sup id="sup15843190155419"><a name="sup15843190155419"></a><a name="sup15843190155419"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p113333549459"><a name="p113333549459"></a><a name="p113333549459"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p933335415453"><a name="p933335415453"></a><a name="p933335415453"></a>Type of the change event. Available values are as follows:</p>
<a name="ul1998831814525"></a><a name="ul1998831814525"></a><ul id="ul1998831814525"><li><strong id="b163190216816"><a name="b163190216816"></a><a name="b163190216816"></a>start</strong>: The <strong id="b69665997"><a name="b69665997"></a><a name="b69665997"></a>value</strong> starts to change.</li><li><strong id="b1732713276817"><a name="b1732713276817"></a><a name="b1732713276817"></a>move</strong>: The <strong id="b12607157190"><a name="b12607157190"></a><a name="b12607157190"></a>value</strong> is changing with users' dragging.</li><li><strong id="b8771301819"><a name="b8771301819"></a><a name="b8771301819"></a>end</strong>: The <strong id="b670519441891"><a name="b670519441891"></a><a name="b670519441891"></a>value</strong> stops changing.</li></ul>
</td>
</tr>
</tbody>
</table>
## Example<a name="section166243517816"></a> | Name| Parameter| Description|
| -------- | -------- | -------- |
| change | ChangeEvent | Triggered when the value changes.|
``` **Table 1** ChangeEvent
| Attribute| Type| Description|
| -------- | -------- | -------- |
| value<sup>5+</sup> | number | Current value of the slider.|
| mode<sup>5+</sup> | string | Type of the change event. Available values are as follows:<br>- **start**: The **value** starts to change.<br>- **move**: The **value** is changing with users' dragging.<br>- **end**: The **value** stops changing.|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text>slider start value is {{startValue}}</text> <text>slider start value is {{startValue}}</text>
...@@ -244,18 +66,17 @@ In addition to the events in [Universal Events](js-components-common-events.md) ...@@ -244,18 +66,17 @@ In addition to the events in [Universal Events](js-components-common-events.md)
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -274,10 +95,12 @@ export default { ...@@ -274,10 +95,12 @@ export default {
} else if (e.mode == "end") { } else if (e.mode == "end") {
this.value = e.value; this.value = e.value;
this.endValue = e.value; this.endValue = e.value;
} else if (e.mode == "click) {
this.value = e.value;
this.currentValue = e.value;
} }
} }
} }
``` ```
![](figures/slider.png) ![slider](figures/slider.png)
# span<a name="EN-US_TOPIC_0000001127284860"></a> # span
The **<span\>** child component of **<[text](js-components-basic-text.md)\>** is used as a text modifier. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> As a child component of **[\<text>](../arkui-js/js-components-basic-text.md)**, the **\<span>** component is used as a text modifier.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Component
The **<span\>** child component is supported.
## Attributes<a name="section2907183951110"></a>
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The **focusable** and **disabled** attributes are not supported.
## Styles<a name="section5775351116"></a>
Only the following style attributes are supported.
<a name="ta0a517e341374f8dbac91fcbabd0a5ff"></a>
<table><thead align="left"><tr id="r4898f887897a46fab1b4999a4f83402f"><th class="cellrowborder" valign="top" width="21.21212121212121%" id="mcps1.1.6.1.1"><p id="ac9b6b02cd94942a5a0de6e18b10be274"><a name="ac9b6b02cd94942a5a0de6e18b10be274"></a><a name="ac9b6b02cd94942a5a0de6e18b10be274"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="15.8015801580158%" id="mcps1.1.6.1.2"><p id="acdcd659d46f24eac86378824c8ee463b"><a name="acdcd659d46f24eac86378824c8ee463b"></a><a name="acdcd659d46f24eac86378824c8ee463b"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="14.231423142314231%" id="mcps1.1.6.1.3"><p id="a9def453e9df6412bba79b8fff70869e8"><a name="a9def453e9df6412bba79b8fff70869e8"></a><a name="a9def453e9df6412bba79b8fff70869e8"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.400940094009401%" id="mcps1.1.6.1.4"><p id="a1e15f96e33ee48b9a0e14dbee0968f8a"><a name="a1e15f96e33ee48b9a0e14dbee0968f8a"></a><a name="a1e15f96e33ee48b9a0e14dbee0968f8a"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="39.35393539353936%" id="mcps1.1.6.1.5"><p id="a7168bff3ff0647d88967647f6ab26d5f"><a name="a7168bff3ff0647d88967647f6ab26d5f"></a><a name="a7168bff3ff0647d88967647f6ab26d5f"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r32272055007144f79a2dfea8a786e589"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="afc75d8f275cc41089a4e4dc8a3fbee88"><a name="afc75d8f275cc41089a4e4dc8a3fbee88"></a><a name="afc75d8f275cc41089a4e4dc8a3fbee88"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="abf3cdb4352d94dbb96789b9920bff09e"><a name="abf3cdb4352d94dbb96789b9920bff09e"></a><a name="abf3cdb4352d94dbb96789b9920bff09e"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a40a852f6f3624109acdb18b89f75be07"><a name="a40a852f6f3624109acdb18b89f75be07"></a><a name="a40a852f6f3624109acdb18b89f75be07"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a61aed770cf534f06a236a689df6206e0"><a name="a61aed770cf534f06a236a689df6206e0"></a><a name="a61aed770cf534f06a236a689df6206e0"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a745abab21c7c47afbb4343f611f13f0e"><a name="a745abab21c7c47afbb4343f611f13f0e"></a><a name="a745abab21c7c47afbb4343f611f13f0e"></a>Font color of the modified text.</p>
</td>
</tr>
<tr id="r9962b94a230e482a9cc74bbb784ea7a0"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a50ed6c7dc89a419b8196eb32f4374eb9"><a name="a50ed6c7dc89a419b8196eb32f4374eb9"></a><a name="a50ed6c7dc89a419b8196eb32f4374eb9"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a3fef950f99bb45768f232285d9563d59"><a name="a3fef950f99bb45768f232285d9563d59"></a><a name="a3fef950f99bb45768f232285d9563d59"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="abf03dbbc119a4a158b410a3676fe71e6"><a name="abf03dbbc119a4a158b410a3676fe71e6"></a><a name="abf03dbbc119a4a158b410a3676fe71e6"></a>30px</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a221074f45b48460a953a19ae07181768"><a name="a221074f45b48460a953a19ae07181768"></a><a name="a221074f45b48460a953a19ae07181768"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a86d755d025194433a3d824ac6308dc19"><a name="a86d755d025194433a3d824ac6308dc19"></a><a name="a86d755d025194433a3d824ac6308dc19"></a>Font size of the modified text.</p>
</td>
</tr>
<tr id="row696318282019"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="p523512225579"><a name="p523512225579"></a><a name="p523512225579"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="p923522212570"><a name="p923522212570"></a><a name="p923522212570"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="p11235322145714"><a name="p11235322145714"></a><a name="p11235322145714"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="p12235112285712"><a name="p12235112285712"></a><a name="p12235112285712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="p1023513229570"><a name="p1023513229570"></a><a name="p1023513229570"></a>Whether the font size of the modified text changes with the system's font size settings.</p>
<div class="note" id="note5531128463"><a name="note5531128463"></a><a name="note5531128463"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p11531172814611"><a name="p11531172814611"></a><a name="p11531172814611"></a>If the <strong id="b9631151853613"><a name="b9631151853613"></a><a name="b9631151853613"></a>config-changes</strong> tag of <strong id="b15641171817360"><a name="b15641171817360"></a><a name="b15641171817360"></a>fontSize</strong> is configured for abilities in the <strong id="b20644418103618"><a name="b20644418103618"></a><a name="b20644418103618"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="rde507e70d93643ae8a6cb2d27c6acf99"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="ab1137579b73e4a38a6dbe7fe5d83e8e2"><a name="ab1137579b73e4a38a6dbe7fe5d83e8e2"></a><a name="ab1137579b73e4a38a6dbe7fe5d83e8e2"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="ab7f6c9ddf05c44bda226d9bf186583eb"><a name="ab7f6c9ddf05c44bda226d9bf186583eb"></a><a name="ab7f6c9ddf05c44bda226d9bf186583eb"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a763035129469427a9b607b50c93c046d"><a name="a763035129469427a9b607b50c93c046d"></a><a name="a763035129469427a9b607b50c93c046d"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="abdb1cd99a9c84f31b1bb21da686ded28"><a name="abdb1cd99a9c84f31b1bb21da686ded28"></a><a name="abdb1cd99a9c84f31b1bb21da686ded28"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a04816275b7d249079b4a1e80f69ea86e"><a name="a04816275b7d249079b4a1e80f69ea86e"></a><a name="a04816275b7d249079b4a1e80f69ea86e"></a>Font style of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">font-style</a> of the <strong id="b18795152647"><a name="b18795152647"></a><a name="b18795152647"></a>text</strong> component.</p>
</td>
</tr>
<tr id="r41ee5629370e4317a0da49957e128ade"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a380a51eccb244ea9a528c41348105934"><a name="a380a51eccb244ea9a528c41348105934"></a><a name="a380a51eccb244ea9a528c41348105934"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a6998d5f15b9d47dfb5ea5d683f2945ef"><a name="a6998d5f15b9d47dfb5ea5d683f2945ef"></a><a name="a6998d5f15b9d47dfb5ea5d683f2945ef"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a9cd90194128142d6bf6a0279aa8d191e"><a name="a9cd90194128142d6bf6a0279aa8d191e"></a><a name="a9cd90194128142d6bf6a0279aa8d191e"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a16edddde0d944b13a7a3567677cc913d"><a name="a16edddde0d944b13a7a3567677cc913d"></a><a name="a16edddde0d944b13a7a3567677cc913d"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="aa1d0d3abf811468e8c3f707e1a7e5b8c"><a name="aa1d0d3abf811468e8c3f707e1a7e5b8c"></a><a name="aa1d0d3abf811468e8c3f707e1a7e5b8c"></a>Font weight of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b1695595210517"><a name="b1695595210517"></a><a name="b1695595210517"></a>text</strong> component.</p>
</td>
</tr>
<tr id="r8bf92fd80ab14f6a824003dcc7f3008c"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="ab4ed51f180194575856b899947e2c4d4"><a name="ab4ed51f180194575856b899947e2c4d4"></a><a name="ab4ed51f180194575856b899947e2c4d4"></a>text-decoration</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="ab4048c7eccf046bab1dbdd33a0739e42"><a name="ab4048c7eccf046bab1dbdd33a0739e42"></a><a name="ab4048c7eccf046bab1dbdd33a0739e42"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a572fe437851c45b2a91c3748dbf3c0c3"><a name="a572fe437851c45b2a91c3748dbf3c0c3"></a><a name="a572fe437851c45b2a91c3748dbf3c0c3"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a4e2f6f648ebc4d6d947a3edb6efe22fb"><a name="a4e2f6f648ebc4d6d947a3edb6efe22fb"></a><a name="a4e2f6f648ebc4d6d947a3edb6efe22fb"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="aa83ac8481649423b80b326de4eb5fefb"><a name="aa83ac8481649423b80b326de4eb5fefb"></a><a name="aa83ac8481649423b80b326de4eb5fefb"></a>Text decoration of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">text-decoration</a> of the <strong id="b1528363213719"><a name="b1528363213719"></a><a name="b1528363213719"></a>text</strong> component.</p>
</td>
</tr>
<tr id="rc154005d2ebf483faffebbe0a509770d"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a552bd7aa0bc94b118d88abf167e87a35"><a name="a552bd7aa0bc94b118d88abf167e87a35"></a><a name="a552bd7aa0bc94b118d88abf167e87a35"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a0f5cc516346b4cbaa2d46c08bc340eeb"><a name="a0f5cc516346b4cbaa2d46c08bc340eeb"></a><a name="a0f5cc516346b4cbaa2d46c08bc340eeb"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a959e67a1855241a1bb0898b2f57c7148"><a name="a959e67a1855241a1bb0898b2f57c7148"></a><a name="a959e67a1855241a1bb0898b2f57c7148"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a2db078b3c8d64498af048fa12102a2a3"><a name="a2db078b3c8d64498af048fa12102a2a3"></a><a name="a2db078b3c8d64498af048fa12102a2a3"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a52f159b549364d40b7c92d51aba7c1a9"><a name="a52f159b549364d40b7c92d51aba7c1a9"></a><a name="a52f159b549364d40b7c92d51aba7c1a9"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1319514265813"></a>
Only the click event in [Universal Events](js-components-common-events.md) is supported.
## Method<a name="section2291124515582"></a>
Not supported Not supported
## Example Code<a name="section1841815550582"></a>
``` ## Attributes
The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
> **NOTE**
>
> The **focusable** and **disabled** attributes are not supported.
## Styles
Only the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| --------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | - | No | Font color of the modified text. |
| font-size | &lt;length&gt; | 30px | No | Font size of the modified text. |
| allow-scale | boolean | true | No | Whether the font size of the modified text changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| font-style | string | normal | No | Font style of the modified text. For details, see **font-style** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| font-weight | number \| string | normal | No | Font weight of the modified text. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| text-decoration | string | none | No | Text decoration of the modified text. For details, see **text-decoration** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
## Events
Only the click event in [Universal Events](../arkui-js/js-components-common-events.md) is supported.
## Methods
Not supported
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
...@@ -135,7 +61,7 @@ Not supported ...@@ -135,7 +61,7 @@ Not supported
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -154,5 +80,4 @@ Not supported ...@@ -154,5 +80,4 @@ Not supported
} }
``` ```
![](figures/en-us_image_0000001152588626.png) ![en-us_image_0000001152588626](figures/en-us_image_0000001152588626.png)
# switch<a name="EN-US_TOPIC_0000001127125072"></a> # switch
The **<switch\>** component is used to enable or disable a function. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<switch>** component is used to enable or disable a function.
## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
None ## Child Components
## Attributes<a name="section2907183951110"></a> Not supported
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a> ## Attributes
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row187510515582"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1126255375818"><a name="p1126255375818"></a><a name="p1126255375818"></a>checked</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p826225395810"><a name="p826225395810"></a><a name="p826225395810"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1126210533587"><a name="p1126210533587"></a><a name="p1126210533587"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p10262185375814"><a name="p10262185375814"></a><a name="p10262185375814"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p526295335811"><a name="p526295335811"></a><a name="p526295335811"></a>Whether the component is checked or not.</p>
</td>
</tr>
<tr id="row18459154995812"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p17262853175817"><a name="p17262853175817"></a><a name="p17262853175817"></a>showtext</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p122621153175814"><a name="p122621153175814"></a><a name="p122621153175814"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1126365310589"><a name="p1126365310589"></a><a name="p1126365310589"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11263195345814"><a name="p11263195345814"></a><a name="p11263195345814"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p172631453135816"><a name="p172631453135816"></a><a name="p172631453135816"></a>Whether the component displays text.</p>
</td>
</tr>
<tr id="row55711479587"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p626355311584"><a name="p626355311584"></a><a name="p626355311584"></a>texton</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p72637533582"><a name="p72637533582"></a><a name="p72637533582"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p182634538587"><a name="p182634538587"></a><a name="p182634538587"></a>"On"</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p112631153185813"><a name="p112631153185813"></a><a name="p112631153185813"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p3263753175817"><a name="p3263753175817"></a><a name="p3263753175817"></a>Text displayed when the component is checked.</p>
</td>
</tr>
<tr id="row116161444115812"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p32631553145810"><a name="p32631553145810"></a><a name="p32631553145810"></a>textoff</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p11263253105816"><a name="p11263253105816"></a><a name="p11263253105816"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p182632539586"><a name="p182632539586"></a><a name="p182632539586"></a>"Off"</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p3263195375819"><a name="p3263195375819"></a><a name="p3263195375819"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p19263185312583"><a name="p19263185312583"></a><a name="p19263185312583"></a>Text displayed when the component is not checked.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. | Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | ----- | ---- | ---------- |
| checked | boolean | false | No | Whether the component is checked or not. |
| showtext | boolean | false | No | Whether the component displays text. |
| texton | string | "On" | No | Text displayed when the component is checked. |
| textoff | string | "Off" | No | Text displayed when the component is not checked.|
<a name="table18141141019"></a>
<table><thead align="left"><tr id="row17141841318"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p814213411616"><a name="p814213411616"></a><a name="p814213411616"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="p101428411816"><a name="p101428411816"></a><a name="p101428411816"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p1214219411518"><a name="p1214219411518"></a><a name="p1214219411518"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p1814213417115"><a name="p1814213417115"></a><a name="p1814213417115"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p5142174112118"><a name="p5142174112118"></a><a name="p5142174112118"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row15142941912"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p141422413117"><a name="p141422413117"></a><a name="p141422413117"></a>texton-color(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p21426411815"><a name="p21426411815"></a><a name="p21426411815"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1614210411718"><a name="p1614210411718"></a><a name="p1614210411718"></a>#000000</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p414264111119"><a name="p414264111119"></a><a name="p414264111119"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p17142194118113"><a name="p17142194118113"></a><a name="p17142194118113"></a>Text color displayed when the component is checked.</p>
</td>
</tr>
<tr id="row01425413117"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p31426419115"><a name="p31426419115"></a><a name="p31426419115"></a>textoff-color(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p714211411914"><a name="p714211411914"></a><a name="p714211411914"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1614244112117"><a name="p1614244112117"></a><a name="p1614244112117"></a>#000000</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1914294116111"><a name="p1914294116111"></a><a name="p1914294116111"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p7142041512"><a name="p7142041512"></a><a name="p7142041512"></a>Text color displayed when the component is not checked.</p>
</td>
</tr>
<tr id="row21421741914"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p15143441811"><a name="p15143441811"></a><a name="p15143441811"></a>text-padding(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p12143741518"><a name="p12143741518"></a><a name="p12143741518"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p9143241114"><a name="p9143241114"></a><a name="p9143241114"></a>0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p101439419117"><a name="p101439419117"></a><a name="p101439419117"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p714374115110"><a name="p714374115110"></a><a name="p714374115110"></a>Distance between the two sides of the longest text in <strong id="b143766341196"><a name="b143766341196"></a><a name="b143766341196"></a>texton</strong> and <strong id="b1838317345192"><a name="b1838317345192"></a><a name="b1838317345192"></a>textoff</strong> and the border of the slider.</p>
</td>
</tr>
<tr id="row19143194112115"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1614364119110"><a name="p1614364119110"></a><a name="p1614364119110"></a>font-size(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p11436419111"><a name="p11436419111"></a><a name="p11436419111"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p21431416117"><a name="p21431416117"></a><a name="p21431416117"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p014313412014"><a name="p014313412014"></a><a name="p014313412014"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p19143184110114"><a name="p19143184110114"></a><a name="p19143184110114"></a>Font size. This attribute is available only when <strong id="b2605184019198"><a name="b2605184019198"></a><a name="b2605184019198"></a>texton</strong> and <strong id="b18612114016193"><a name="b18612114016193"></a><a name="b18612114016193"></a>textoff</strong> are set.</p>
</td>
</tr>
<tr id="row514317411319"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1143241119"><a name="p1143241119"></a><a name="p1143241119"></a>allow-scale(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p1914314117112"><a name="p1914314117112"></a><a name="p1914314117112"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p514319415118"><a name="p514319415118"></a><a name="p514319415118"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p71431411417"><a name="p71431411417"></a><a name="p71431411417"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p71435417112"><a name="p71435417112"></a><a name="p71435417112"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note214334112118"><a name="note214334112118"></a><a name="note214334112118"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p3143174118114"><a name="p3143174118114"></a><a name="p3143174118114"></a>If the <strong id="b524714361237"><a name="b524714361237"></a><a name="b524714361237"></a>config-changes</strong> tag of <strong id="b19256136236"><a name="b19256136236"></a><a name="b19256136236"></a>fontSize</strong> is configured for abilities in the <strong id="b32576360318"><a name="b32576360318"></a><a name="b32576360318"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="row114334114116"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p81431141814"><a name="p81431141814"></a><a name="p81431141814"></a>font-style(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p20144941015"><a name="p20144941015"></a><a name="p20144941015"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1514464111120"><a name="p1514464111120"></a><a name="p1514464111120"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1914484118112"><a name="p1914484118112"></a><a name="p1914484118112"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p61446412015"><a name="p61446412015"></a><a name="p61446412015"></a>Font style. This attribute is available only when <strong id="b19186714194419"><a name="b19186714194419"></a><a name="b19186714194419"></a>texton</strong> and <strong id="b480316171449"><a name="b480316171449"></a><a name="b480316171449"></a>textoff</strong> are set. For details, see <a href="js-components-basic-text.md#section5775351116">font-style</a> of the <strong id="b12931164418193"><a name="b12931164418193"></a><a name="b12931164418193"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row1414434118113"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p91441641917"><a name="p91441641917"></a><a name="p91441641917"></a>font-weight(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p17144241417"><a name="p17144241417"></a><a name="p17144241417"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p17144184118118"><a name="p17144184118118"></a><a name="p17144184118118"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p2144144115118"><a name="p2144144115118"></a><a name="p2144144115118"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1714484118114"><a name="p1714484118114"></a><a name="p1714484118114"></a>Font weight. This attribute is available only when <strong id="b419312514441"><a name="b419312514441"></a><a name="b419312514441"></a>texton</strong> and <strong id="b8521102704413"><a name="b8521102704413"></a><a name="b8521102704413"></a>textoff</strong> are set. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b15764157161917"><a name="b15764157161917"></a><a name="b15764157161917"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row16144154118117"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1914419411613"><a name="p1914419411613"></a><a name="p1914419411613"></a>font-family(Rich)</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p61447411415"><a name="p61447411415"></a><a name="p61447411415"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p191448411817"><a name="p191448411817"></a><a name="p191448411817"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p314415411118"><a name="p314415411118"></a><a name="p314415411118"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p614414411115"><a name="p614414411115"></a><a name="p614414411115"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text. This attribute is available only when <strong id="b77641525192017"><a name="b77641525192017"></a><a name="b77641525192017"></a>texton</strong> and <strong id="b1477292511201"><a name="b1477292511201"></a><a name="b1477292511201"></a>textoff</strong> are set.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1042893411015"></a> ## Styles
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
<a name="table4429183420016"></a> | Name | Type | Default Value | Mandatory | Description |
<table><thead align="left"><tr id="row14295345017"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p342910341105"><a name="p342910341105"></a><a name="p342910341105"></a>Name</p> | ------------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
</th> | texton-color(Rich) | &lt;color&gt; | \#000000 | No | Text color displayed when the component is checked. |
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="p142913343017"><a name="p142913343017"></a><a name="p142913343017"></a>Parameter</p> | textoff-color(Rich) | &lt;color&gt; | \#000000 | No | Text color displayed when the component is not checked. |
</th> | text-padding(Rich) | number | 0px | No | Distance between the two sides of the longest text in **texton** and **textoff** and the border of the slider. |
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="p6429034005"><a name="p6429034005"></a><a name="p6429034005"></a>Description</p> | font-size(Rich) | &lt;length&gt; | - | No | Font size. This attribute is available only when **texton** and **textoff** are set. |
</th> | allow-scale(Rich) | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
</tr> | font-style(Rich) | string | normal | No | Font style. This attribute is available only when **texton** and **textoff** are set. For details, see **font-style** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
</thead> | font-weight(Rich) | number \| string | normal | No | Font weight. This attribute is available only when **texton** and **textoff** are set. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
<tbody><tr id="row94293341601"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p842910342010"><a name="p842910342010"></a><a name="p842910342010"></a>change</p> | font-family(Rich) | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text. This attribute is available only when **texton** and **textoff** are set.|
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p342917344013"><a name="p342917344013"></a><a name="p342917344013"></a>{ checked: checkedValue }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p24295341304"><a name="p24295341304"></a><a name="p24295341304"></a>Triggered when the <strong id="b611663315206"><a name="b611663315206"></a><a name="b611663315206"></a>checked</strong> state changes.</p>
</td>
</tr>
</tbody>
</table>
## Method<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported. ## Events
## Example Code<a name="section1149419101412"></a> In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
``` | Name | Parameter | Description |
| ------ | ---------------------------------------- | ------------- |
| change | { checked: checkedValue } | Triggered when the **checked** state changes.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<switch showtext="true" texton="On" textoff="Off" checked="true" @change="switchChange"> <switch showtext="true" texton="On" textoff="Off" checked="true" @change="switchChange">
...@@ -221,7 +66,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -221,7 +66,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -235,7 +80,7 @@ switch{ ...@@ -235,7 +80,7 @@ switch{
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -257,5 +102,4 @@ export default { ...@@ -257,5 +102,4 @@ export default {
} }
``` ```
![](figures/en-us_image_0000001152862510.gif) ![en-us_image_0000001152862510](figures/en-us_image_0000001152862510.gif)
# text<a name="EN-US_TOPIC_0000001127125018"></a> # text
The **<text\>** component is used to display a piece of textual information. > **NOTE**
>
> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The text content must be written in the content area.
>![](../../public_sys-resources/icon-note.gif) **NOTE:** The **\<text>** component is used to display a piece of textual information.
>- The text content must be written in the content area.
## Required Permissions<a name="section11257113618419"></a> ## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
**<[span](js-components-basic-span.md)\>** is supported. ## Child Components
## Attributes<a name="section2907183951110"></a> Only the **[\<span>](../arkui-js/js-components-basic-span.md)** component is supported.
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section5775351116"></a> ## Attributes
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
<a name="table11509320639"></a>
<table><thead align="left"><tr id="row1550982016312"><th class="cellrowborder" valign="top" width="16.58834116588341%" id="mcps1.1.6.1.1"><p id="p125091520234"><a name="p125091520234"></a><a name="p125091520234"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.37876212378762%" id="mcps1.1.6.1.2"><p id="p1509102011311"><a name="p1509102011311"></a><a name="p1509102011311"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="20.907909209079094%" id="mcps1.1.6.1.3"><p id="p6509320638"><a name="p6509320638"></a><a name="p6509320638"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="5.959404059594041%" id="mcps1.1.6.1.4"><p id="p6509220933"><a name="p6509220933"></a><a name="p6509220933"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="44.16558344165583%" id="mcps1.1.6.1.5"><p id="p950911201138"><a name="p950911201138"></a><a name="p950911201138"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row205092202034"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p105090201332"><a name="p105090201332"></a><a name="p105090201332"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1050917201310"><a name="p1050917201310"></a><a name="p1050917201310"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p155090201833"><a name="p155090201833"></a><a name="p155090201833"></a>#e5000000</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p4509720836"><a name="p4509720836"></a><a name="p4509720836"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p18509132017312"><a name="p18509132017312"></a><a name="p18509132017312"></a>Text color.</p>
</td>
</tr>
<tr id="row65091120339"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p3509122017312"><a name="p3509122017312"></a><a name="p3509122017312"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1750912203310"><a name="p1750912203310"></a><a name="p1750912203310"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p17510122018310"><a name="p17510122018310"></a><a name="p17510122018310"></a>30px</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p151014201234"><a name="p151014201234"></a><a name="p151014201234"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p5510520039"><a name="p5510520039"></a><a name="p5510520039"></a>Font size (px).</p>
</td>
</tr>
<tr id="row1351011202036"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p851019201937"><a name="p851019201937"></a><a name="p851019201937"></a>allow-scale </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1751052012312"><a name="p1751052012312"></a><a name="p1751052012312"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p65103201312"><a name="p65103201312"></a><a name="p65103201312"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p651012207315"><a name="p651012207315"></a><a name="p651012207315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p1951012205310"><a name="p1951012205310"></a><a name="p1951012205310"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note12510112010317"><a name="note12510112010317"></a><a name="note12510112010317"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p10510720332"><a name="p10510720332"></a><a name="p10510720332"></a>For details about how to make the configuration take effect dynamically, see the <strong id="b65592247511"><a name="b65592247511"></a><a name="b65592247511"></a>config-changes</strong> attribute in the <strong id="b1576712361551"><a name="b1576712361551"></a><a name="b1576712361551"></a>config.json</strong> file.</p>
</div></div>
</td>
</tr>
<tr id="row251042012318"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p15510120730"><a name="p15510120730"></a><a name="p15510120730"></a>letter-spacing</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p651012011314"><a name="p651012011314"></a><a name="p651012011314"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p195101320132"><a name="p195101320132"></a><a name="p195101320132"></a>0 px </p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p951020207320"><a name="p951020207320"></a><a name="p951020207320"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p75108209318"><a name="p75108209318"></a><a name="p75108209318"></a>Character spacing (px).</p>
</td>
</tr>
<tr id="row946783210188"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p1246710327185"><a name="p1246710327185"></a><a name="p1246710327185"></a>word-spacing<sup id="sup1961211505"><a name="sup1961211505"></a><a name="sup1961211505"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p134671832131819"><a name="p134671832131819"></a><a name="p134671832131819"></a>&lt;length&gt; | &lt;percentage&gt; | string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p146753217185"><a name="p146753217185"></a><a name="p146753217185"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p1946723291815"><a name="p1946723291815"></a><a name="p1946723291815"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p3467173291810"><a name="p3467173291810"></a><a name="p3467173291810"></a>Spacing between texts. The options are as follows:</p>
<p id="p153692104121"><a name="p153692104121"></a><a name="p153692104121"></a><strong id="b146318161288"><a name="b146318161288"></a><a name="b146318161288"></a>normal</strong>: default spacing.</p>
</td>
</tr>
<tr id="row85101205320"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p751020201136"><a name="p751020201136"></a><a name="p751020201136"></a>font-style </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p251020201132"><a name="p251020201132"></a><a name="p251020201132"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p15510720734"><a name="p15510720734"></a><a name="p15510720734"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p25105201439"><a name="p25105201439"></a><a name="p25105201439"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p95101120238"><a name="p95101120238"></a><a name="p95101120238"></a>Font style. Available values are as follows:</p>
<a name="ul85109201131"></a><a name="ul85109201131"></a><ul id="ul85109201131"><li><strong id="b111931527399"><a name="b111931527399"></a><a name="b111931527399"></a>normal</strong>: standard font style</li><li><strong id="b641135983918"><a name="b641135983918"></a><a name="b641135983918"></a>italic</strong>: italic font style</li></ul>
</td>
</tr>
<tr id="row14510182017316"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p951112201931"><a name="p951112201931"></a><a name="p951112201931"></a>font-weight </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1151112201333"><a name="p1151112201333"></a><a name="p1151112201333"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p1251115201137"><a name="p1251115201137"></a><a name="p1251115201137"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p1551110206310"><a name="p1551110206310"></a><a name="p1551110206310"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p135113209314"><a name="p135113209314"></a><a name="p135113209314"></a>Font width. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a larger font width.</p>
<div class="note" id="note851111201435"><a name="note851111201435"></a><a name="note851111201435"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p15111020534"><a name="p15111020534"></a><a name="p15111020534"></a>The value must be an integer multiple of 100.</p>
</div></div>
<p id="p451182013310"><a name="p451182013310"></a><a name="p451182013310"></a>The value of the string type can be <strong id="b09316811414"><a name="b09316811414"></a><a name="b09316811414"></a>lighter</strong>, <strong id="b1952261211416"><a name="b1952261211416"></a><a name="b1952261211416"></a>normal</strong>, <strong id="b414611515413"><a name="b414611515413"></a><a name="b414611515413"></a>bold</strong>, or <strong id="b871421813416"><a name="b871421813416"></a><a name="b871421813416"></a>bolder</strong>.</p>
</td>
</tr>
<tr id="row125112201639"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p19511182014314"><a name="p19511182014314"></a><a name="p19511182014314"></a>text-decoration </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p351111201339"><a name="p351111201339"></a><a name="p351111201339"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p155111205314"><a name="p155111205314"></a><a name="p155111205314"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p551152012314"><a name="p551152012314"></a><a name="p551152012314"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p1751117201737"><a name="p1751117201737"></a><a name="p1751117201737"></a>Text decoration. Available values are as follows:</p>
<a name="ul9511720637"></a><a name="ul9511720637"></a><ul id="ul9511720637"><li><strong id="b164849427323"><a name="b164849427323"></a><a name="b164849427323"></a>underline</strong>: An underline is used.</li><li><strong id="b1562604511325"><a name="b1562604511325"></a><a name="b1562604511325"></a>line-through</strong>: A strikethrough is used.</li><li><strong id="b13748195193210"><a name="b13748195193210"></a><a name="b13748195193210"></a>none</strong>: The standard text is used.</li></ul>
</td>
</tr>
<tr id="row6436204121315"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p1437194171313"><a name="p1437194171313"></a><a name="p1437194171313"></a>text-decoration-color<sup id="sup7239161572910"><a name="sup7239161572910"></a><a name="sup7239161572910"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p7437124121317"><a name="p7437124121317"></a><a name="p7437124121317"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p104371941161317"><a name="p104371941161317"></a><a name="p104371941161317"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p1743764161320"><a name="p1743764161320"></a><a name="p1743764161320"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p2437104151319"><a name="p2437104151319"></a><a name="p2437104151319"></a>Color of the text decoration.</p>
</td>
</tr>
<tr id="row95113208317"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p651118201637"><a name="p651118201637"></a><a name="p651118201637"></a>text-align</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p205112201337"><a name="p205112201337"></a><a name="p205112201337"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p951202013319"><a name="p951202013319"></a><a name="p951202013319"></a>start</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p18512192018319"><a name="p18512192018319"></a><a name="p18512192018319"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p651214206312"><a name="p651214206312"></a><a name="p651214206312"></a>Text alignment mode. Available values are as follows:</p>
<a name="ul11512120336"></a><a name="ul11512120336"></a><ul id="ul11512120336"><li><strong id="b1068915261435"><a name="b1068915261435"></a><a name="b1068915261435"></a>left</strong>: The text is left-aligned.</li><li><strong id="b7194633134312"><a name="b7194633134312"></a><a name="b7194633134312"></a>center</strong>: The text is center-aligned.</li><li><strong id="b12787113444310"><a name="b12787113444310"></a><a name="b12787113444310"></a>right</strong>: The text is right-aligned.</li><li><strong id="b5698814174419"><a name="b5698814174419"></a><a name="b5698814174419"></a>start</strong>: The text is aligned with the direction in which the text is written.</li><li><strong id="b941011915456"><a name="b941011915456"></a><a name="b941011915456"></a>end</strong>: The text is aligned with the opposite direction in which the text is written. </li></ul>
<div class="note" id="note14512192013312"><a name="note14512192013312"></a><a name="note14512192013312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p16513320938"><a name="p16513320938"></a><a name="p16513320938"></a>If the text width is not specified, the alignment effect may not be obvious when the text width is the same as the width of the parent container. </p>
</div></div>
</td>
</tr>
<tr id="row0513820638"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p85131120136"><a name="p85131120136"></a><a name="p85131120136"></a>line-height</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p451352012310"><a name="p451352012310"></a><a name="p451352012310"></a>&lt;length&gt; | &lt;percentage&gt;<sup id="sup1397722015236"><a name="sup1397722015236"></a><a name="sup1397722015236"></a>7+</sup> | string<sup id="sup1826415224230"><a name="sup1826415224230"></a><a name="sup1826415224230"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p175883320223"><a name="p175883320223"></a><a name="p175883320223"></a>0px<sup id="sup11204125742215"><a name="sup11204125742215"></a><a name="sup11204125742215"></a>1-6</sup></p>
<p id="p1751342015311"><a name="p1751342015311"></a><a name="p1751342015311"></a>normal<sup id="sup6237425142212"><a name="sup6237425142212"></a><a name="sup6237425142212"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p451320202316"><a name="p451320202316"></a><a name="p451320202316"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p1513520336"><a name="p1513520336"></a><a name="p1513520336"></a>Text line height. When this parameter is set to <strong id="b49513892117"><a name="b49513892117"></a><a name="b49513892117"></a>0px</strong>, the text line height is not limited and the font size is adaptive. The <strong id="b96908348288"><a name="b96908348288"></a><a name="b96908348288"></a>string</strong> values are as follows:</p>
<p id="p203731252121210"><a name="p203731252121210"></a><a name="p203731252121210"></a><strong id="b0710151102820"><a name="b0710151102820"></a><a name="b0710151102820"></a>normal</strong><sup id="sup1522861917228"><a name="sup1522861917228"></a><a name="sup1522861917228"></a>7+</sup>: default line height</p>
</td>
</tr>
<tr id="row851319205318"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p16513162011317"><a name="p16513162011317"></a><a name="p16513162011317"></a>text-overflow</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p12513620931"><a name="p12513620931"></a><a name="p12513620931"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p10513162010316"><a name="p10513162010316"></a><a name="p10513162010316"></a>clip</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p751362018310"><a name="p751362018310"></a><a name="p751362018310"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p65130201310"><a name="p65130201310"></a><a name="p65130201310"></a><span id="ph13751113121520"><a name="ph13751113121520"></a><a name="ph13751113121520"></a>Takes effect when the maximum number of lines is specified. </span>Available values are as follows:</p>
<a name="ul2513142018312"></a><a name="ul2513142018312"></a><ul id="ul2513142018312"><li><strong id="b165145674710"><a name="b165145674710"></a><a name="b165145674710"></a>clip</strong>: The text is clipped and displayed based on the size of the parent container.</li><li><strong id="b1331610118486"><a name="b1331610118486"></a><a name="b1331610118486"></a>ellipsis</strong>: The text is displayed based on the size of the parent container. The text that cannot be displayed is replaced with ellipsis. This style must be used together with <strong id="b774215496487"><a name="b774215496487"></a><a name="b774215496487"></a>max-lines</strong>.</li></ul>
</td>
</tr>
<tr id="row95131920537"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p115131320234"><a name="p115131320234"></a><a name="p115131320234"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p20514102015311"><a name="p20514102015311"></a><a name="p20514102015311"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p25141220839"><a name="p25141220839"></a><a name="p25141220839"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p205145201735"><a name="p205145201735"></a><a name="p205145201735"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p75148201333"><a name="p75148201333"></a><a name="p75148201333"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> in the family is selected as the font for the text. </p>
</td>
</tr>
<tr id="row14514142013319"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p1451411202319"><a name="p1451411202319"></a><a name="p1451411202319"></a>max-lines </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p6514420233"><a name="p6514420233"></a><a name="p6514420233"></a>number | string<sup id="sup1763505811384"><a name="sup1763505811384"></a><a name="sup1763505811384"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p15514102018311"><a name="p15514102018311"></a><a name="p15514102018311"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p35148201135"><a name="p35148201135"></a><a name="p35148201135"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p934052515223"><a name="p934052515223"></a><a name="p934052515223"></a>Maximum number of text lines. The <strong id="b10373134345315"><a name="b10373134345315"></a><a name="b10373134345315"></a>string</strong> values are as follows:</p>
<a name="ul6458027152218"></a><a name="ul6458027152218"></a><ul id="ul6458027152218"><li><strong id="b1132417423294"><a name="b1132417423294"></a><a name="b1132417423294"></a>auto</strong><sup id="sup15460165433814"><a name="sup15460165433814"></a><a name="sup15460165433814"></a>7+</sup>: The number of text lines adapts to the container height.</li></ul>
</td>
</tr>
<tr id="row7514122015312"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p15514182016317"><a name="p15514182016317"></a><a name="p15514182016317"></a>min-font-size </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p55148206312"><a name="p55148206312"></a><a name="p55148206312"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p165146200312"><a name="p165146200312"></a><a name="p165146200312"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p16515420138"><a name="p16515420138"></a><a name="p16515420138"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p125151201636"><a name="p125151201636"></a><a name="p125151201636"></a>Minimum font size in the text. This style must be used together with <strong id="b73481621155012"><a name="b73481621155012"></a><a name="b73481621155012"></a>max-font-size</strong>. The font size can be changed dynamically. After the maximum and minimum font sizes are set, <strong id="b483334111512"><a name="b483334111512"></a><a name="b483334111512"></a>font-size</strong> does not take effect.</p>
</td>
</tr>
<tr id="row20515720537"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p25151620634"><a name="p25151620634"></a><a name="p25151620634"></a>max-font-size </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p135150201639"><a name="p135150201639"></a><a name="p135150201639"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p19515132019318"><a name="p19515132019318"></a><a name="p19515132019318"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p9515120231"><a name="p9515120231"></a><a name="p9515120231"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p11515520038"><a name="p11515520038"></a><a name="p11515520038"></a>Maximum font size in the text. This style must be used together with <strong id="b22010161547"><a name="b22010161547"></a><a name="b22010161547"></a>min-font-size</strong>. The font size can be changed dynamically. After the maximum and minimum font sizes are set, <strong id="b302292867"><a name="b302292867"></a><a name="b302292867"></a>font-size</strong> does not take effect.</p>
</td>
</tr>
<tr id="row155154201838"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p151592017316"><a name="p151592017316"></a><a name="p151592017316"></a>font-size-step </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p151515201233"><a name="p151515201233"></a><a name="p151515201233"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p851562013310"><a name="p851562013310"></a><a name="p851562013310"></a>1px</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p85159201037"><a name="p85159201037"></a><a name="p85159201037"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p1151519205317"><a name="p1151519205317"></a><a name="p1151519205317"></a>Step for dynamically adjusting the font size in the text. The minimum and maximum font sizes must be set.</p>
</td>
</tr>
<tr id="row155151120839"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p851519201036"><a name="p851519201036"></a><a name="p851519201036"></a>prefer-font-sizes </p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1851511201630"><a name="p1851511201630"></a><a name="p1851511201630"></a>&lt;array&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p15515152018315"><a name="p15515152018315"></a><a name="p15515152018315"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p145154204313"><a name="p145154204313"></a><a name="p145154204313"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p851513201317"><a name="p851513201317"></a><a name="p851513201317"></a>Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, <strong id="b1420501110354"><a name="b1420501110354"></a><a name="b1420501110354"></a>text-overflow</strong> is used to truncate the text. If this parameter is set, <strong id="b153751052193511"><a name="b153751052193511"></a><a name="b153751052193511"></a>font-size</strong>, <strong id="b6195125503512"><a name="b6195125503512"></a><a name="b6195125503512"></a>max-font-size</strong>, <strong id="b561587352"><a name="b561587352"></a><a name="b561587352"></a>min-font-size</strong>, and <strong id="b41946114369"><a name="b41946114369"></a><a name="b41946114369"></a>font-size-step</strong> do not take effect.</p>
<p id="p18515202012316"><a name="p18515202012316"></a><a name="p18515202012316"></a>Example values: <strong id="b148981611383"><a name="b148981611383"></a><a name="b148981611383"></a>12px,14px,16px</strong></p>
</td>
</tr>
<tr id="row2298173115914"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p1429820311498"><a name="p1429820311498"></a><a name="p1429820311498"></a>word-break<sup id="sup181941853171717"><a name="sup181941853171717"></a><a name="sup181941853171717"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p122981731691"><a name="p122981731691"></a><a name="p122981731691"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p82985311094"><a name="p82985311094"></a><a name="p82985311094"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p102981231392"><a name="p102981231392"></a><a name="p102981231392"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p329813311491"><a name="p329813311491"></a><a name="p329813311491"></a>Text line breaking mode. The options are as follows:</p>
<a name="ul3839682122"></a><a name="ul3839682122"></a><ul id="ul3839682122"><li><strong id="b329519515225"><a name="b329519515225"></a><a name="b329519515225"></a>normal</strong>: Allows text line breaks between words as appropriate to the relevant language writing systems. This is the default mode.</li><li><strong id="b118015913305"><a name="b118015913305"></a><a name="b118015913305"></a>break-all</strong>: Allows text line breaks between any characters for writing systems other than Chinese, Japanese, and Korean.</li><li><strong id="b1217910513399"><a name="b1217910513399"></a><a name="b1217910513399"></a>break-word</strong>: Has the same effect as <strong id="b187324215494"><a name="b187324215494"></a><a name="b187324215494"></a>break-all</strong>, except that it does not break unbreakable words.</li></ul>
</td>
</tr>
<tr id="row11732453136"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p373219510132"><a name="p373219510132"></a><a name="p373219510132"></a>text-indent<sup id="sup85001052123316"><a name="sup85001052123316"></a><a name="sup85001052123316"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p47321857139"><a name="p47321857139"></a><a name="p47321857139"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p1973212541319"><a name="p1973212541319"></a><a name="p1973212541319"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p77336519137"><a name="p77336519137"></a><a name="p77336519137"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p273314531310"><a name="p273314531310"></a><a name="p273314531310"></a>Indentation of the first line.</p>
</td>
</tr>
<tr id="row483811791617"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p1083916179164"><a name="p1083916179164"></a><a name="p1083916179164"></a>white-space<sup id="sup1527825315332"><a name="sup1527825315332"></a><a name="sup1527825315332"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p2839117121616"><a name="p2839117121616"></a><a name="p2839117121616"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p183981701620"><a name="p183981701620"></a><a name="p183981701620"></a>pre</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p083911713168"><a name="p083911713168"></a><a name="p083911713168"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p9839417181617"><a name="p9839417181617"></a><a name="p9839417181617"></a>Mode for processing blanks in the component. The options are as follows:</p>
<a name="ul9139155131615"></a><a name="ul9139155131615"></a><ul id="ul9139155131615"><li><strong id="b491965183217"><a name="b491965183217"></a><a name="b491965183217"></a>normal</strong>: All spaces, carriage returns, and tabs are combined into one space, and the text is automatically wrapped.</li><li><strong id="b6272101473212"><a name="b6272101473212"></a><a name="b6272101473212"></a>nowrap</strong>: All spaces, carriage returns, and tabs are combined into one space, and the text is not wrapped.</li><li><strong id="b1853091145817"><a name="b1853091145817"></a><a name="b1853091145817"></a>pre</strong>: All contents are output as-is.</li><li><strong id="b16557113373214"><a name="b16557113373214"></a><a name="b16557113373214"></a>pre-wrap</strong>: All contents are output as-is with line breaks.</li><li><strong id="b16445113143320"><a name="b16445113143320"></a><a name="b16445113143320"></a>pre-line</strong>: All spaces and tabs are combined into one space, the carriage return remains unchanged, and the text is wrapped.</li></ul>
</td>
</tr>
<tr id="row10859173188"><td class="cellrowborder" valign="top" width="16.58834116588341%" headers="mcps1.1.6.1.1 "><p id="p168595741814"><a name="p168595741814"></a><a name="p168595741814"></a>adapt-height<sup id="sup10570154133314"><a name="sup10570154133314"></a><a name="sup10570154133314"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.37876212378762%" headers="mcps1.1.6.1.2 "><p id="p1085919791816"><a name="p1085919791816"></a><a name="p1085919791816"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="20.907909209079094%" headers="mcps1.1.6.1.3 "><p id="p208591779182"><a name="p208591779182"></a><a name="p208591779182"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="5.959404059594041%" headers="mcps1.1.6.1.4 "><p id="p38591675189"><a name="p38591675189"></a><a name="p38591675189"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="44.16558344165583%" headers="mcps1.1.6.1.5 "><p id="p2099116133418"><a name="p2099116133418"></a><a name="p2099116133418"></a>Whether the text size adapts to the container height.</p>
<div class="note" id="note1725773504115"><a name="note1725773504115"></a><a name="note1725773504115"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p02571035164111"><a name="p02571035164111"></a><a name="p02571035164111"></a>The settings take effect after font size auto-adaptation is configured.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:** ## Styles
>- In dynamic font adjustment, both the preset size set and the minimum/maximum font sizes are used to adjust the font size to display the text within the maximum number of lines. The preset size set is checked from left to right, and the minimum/maximum font sizes are checked from large to small, to find a size meeting the requirement.
>- Use the escape character **\\r\\n** for newline.
>- The following escape characters are supported: **\\a**, **\\b**, **\\f**, **\\n**, **\\r**, **\\t**, **\\v**, **\\'**, **\\"**, and **\\0**.
>- When you use **<span\>** as a child component to form a text paragraph, note that if a **<span\>** style is abnormal, the text paragraph cannot be displayed.
>- The **letter-spacing**, **text-align**, **line-height**, **text-overflow**, and **max-lines** styles take effect on text content held by the **<text\>** component and its child components \(**<span\>**\).
>- The **<text\>** component does not support the coexistence of the text content and **<span\>** subcomponents. \(If both of them exist, only the content in **<span\>** is displayed.\)
## Events<a name="section1948820711216"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
Events in [Universal Events](js-components-common-events.md) are supported. | Name | Type | Default Value | Mandatory | Description |
| ---------------------------------- | ---------------------------------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | #e5000000 | No | Font color. |
| font-size | &lt;length&gt; | 30px | No | Font size. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>For details about how to make the configuration take effect dynamically, see the **config-changes** attribute in the **config.json** file.|
| letter-spacing | &lt;length&gt; | 0px | No | Character spacing (px). |
| word-spacing<sup>7+</sup> | &lt;length&gt; \| &lt;percentage&gt; \| string | normal | No | Spacing between texts. If the input is a string, the options are as follows:<br>**normal**: default spacing.|
| font-style | string | normal | No | Font style. Available values are as follows:<br>- **normal**: standard font style<br>- **italic**: italic font style|
| font-weight | number \| string | normal | No | Font width. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a larger font width. The value of the number type must be an integer multiple of 100.<br>The value of the string type can be **lighter**, **normal**, **bold**, or **bolder**.|
| text-decoration | string | none | No | Text decoration. Available values are as follows:<br>- **underline**: An underline is used.<br>- **line-through**: A strikethrough is used.<br>- **none**: The standard text is used.|
| text-decoration-color<sup>7+</sup> | &lt;color&gt; | - | No | Color of the text decoration. |
| text-align | string | start<br> | No | Text alignment mode. Available values are as follows:<br>- **left**: The text is left-aligned.<br>- **center**: The text is center-aligned.<br>- **right**: The text is right-aligned.<br>- **start**: The text is aligned with the direction in which the text is written.<br>- **end**: The text is aligned with the opposite direction in which the text is written.<br>If the text width is not specified, the alignment effect may not be obvious when the text width is the same as the width of the parent container.|
| line-height | &lt;length&gt; \| &lt;percentage&gt;<sup>7+</sup> \| string<sup>7+</sup> | 0px<sup>1-6</sup><br>normal<sup>7+</sup> | No | Text line height. When this parameter is set to **0px**, the text line height is not limited and the font size is adaptive. The value of the string type is as follows:<br>**normal**<sup>7+</sup>: default line height |
| text-overflow | string | clip | No | Display mode when the text is too long. This style takes effect when the maximum number of lines is specified. Available values are as follows:<br>- **clip**: The text is clipped and displayed based on the size of the parent container.<br>- **ellipsis**: The text is displayed based on the size of the parent container. The text that cannot be displayed is replaced with ellipsis. This style must be used together with **max-lines**.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| max-lines | number \| string<sup>7+</sup> | - | No | Maximum number of text lines. The value of the string type is as follows:<br>- **auto**<sup>7+</sup>: The number of text lines adapts to the container height. |
| min-font-size | &lt;length&gt; | - | No | Minimum font size in the text. This style must be used together with **max-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| max-font-size | &lt;length&gt; | - | No | Maximum font size in the text. This style must be used together with **min-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| font-size-step | &lt;length&gt; | 1px | No | Step for dynamically adjusting the font size in the text. The minimum and maximum font sizes must be set. |
| prefer-font-sizes | &lt;array&gt; | - | No | Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, **text-overflow** is used to truncate the text. If this parameter is set, **font-size**, **max-font-size**, **min-font-size**, and **font-size-step** do not take effect.<br>Example values: **12px,14px,16px**|
| word-break<sup>6+</sup> | string | normal | No | Text line breaking mode. The options are as follows:<br>- **normal**: Allows text line breaks between words as appropriate to the relevant language writing systems. This is the default mode.<br>- **break-all**: Allows text line breaks between any characters for writing systems other than Chinese, Japanese, and Korean.<br>- **break-word**: Works in the same way as **break-all**, except that it does not break unbreakable words.|
| text-indent<sup>7+</sup> | &lt;length&gt; | - | No | Indentation of the first line. |
| white-space<sup>7+</sup> | string | pre | No | Mode for processing blanks in the component. The options are as follows:<br>- **normal**: All spaces, carriage returns, and tabs are combined into one space, and the text is automatically wrapped.<br>- **nowrap**: All spaces, carriage returns, and tabs are combined into one space, and the text is not wrapped.<br>- **pre**: All contents are output as-is.<br>- **pre-wrap**: All contents are output as-is with line breaks.<br>- **pre-line**: All spaces and tabs are combined into one space, the carriage return remains unchanged, and the text is wrapped.|
| adapt-height<sup>7+</sup> | boolean | false | No | Whether the text size adapts to the container height.<br>The settings take effect after font size auto-adaptation is configured. |
## Method<a name="section2279124532420"></a> > **NOTE**
> - In dynamic font adjustment, both the preset size set and the minimum/maximum font sizes are used to adjust the font size to display the text within the maximum number of lines. The preset size set is checked from left to right, and the minimum/maximum font sizes are checked from large to small, to find a size meeting the requirement.
>
> - Use the escape character **\r\n** for newline.
>
> - The following escape characters are supported: **\a**, **\b**, **\f**, **\n**, **\r**, **\t**, **\v**, **\'**, **\"**, and **\0**.
>
> - When you use **\<span>** as a child component to form a text paragraph, note that if a **\<span>** style is abnormal, the text paragraph cannot be displayed.
>
> - The **letter-spacing**, **text-align**, **line-height**, **text-overflow**, and **max-lines** styles take effect on text content held by the **\<text>** component and its child components (**\<span>**).
>
> - 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.
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example Code<a name="section13294026042"></a> ## Events
``` The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<div class="content"> <div class="content">
...@@ -328,7 +88,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -328,7 +88,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -348,7 +108,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -348,7 +108,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -357,9 +117,9 @@ export default { ...@@ -357,9 +117,9 @@ export default {
} }
``` ```
![](figures/3.png) ![3](figures/3.png)
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text class="text1"> <text class="text1">
...@@ -371,7 +131,7 @@ export default { ...@@ -371,7 +131,7 @@ export default {
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -396,5 +156,4 @@ export default { ...@@ -396,5 +156,4 @@ export default {
} }
``` ```
![](figures/2.png) ![2](figures/2.png)
# textarea<a name="EN-US_TOPIC_0000001173324595"></a> # textarea
The **<textarea\>** component provides a text box to receive multi-line text input. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<textarea>** component provides a text box to receive multi-line text input.
## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
<a name="table20633101642315"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row207976211241"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1172110226415"><a name="p1172110226415"></a><a name="p1172110226415"></a>placeholder</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1572111221649"><a name="p1572111221649"></a><a name="p1572111221649"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1072112229411"><a name="p1072112229411"></a><a name="p1072112229411"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p197218228415"><a name="p197218228415"></a><a name="p197218228415"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1372114227414"><a name="p1372114227414"></a><a name="p1372114227414"></a>Content of the hint text.</p>
</td>
</tr>
<tr id="row57972211740"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p18721522047"><a name="p18721522047"></a><a name="p18721522047"></a>maxlength</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p127225224413"><a name="p127225224413"></a><a name="p127225224413"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p19722172217410"><a name="p19722172217410"></a><a name="p19722172217410"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p27223221745"><a name="p27223221745"></a><a name="p27223221745"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1872218223415"><a name="p1872218223415"></a><a name="p1872218223415"></a>Maximum number of characters that can be entered in the multi-line text box.</p>
</td>
</tr>
<tr id="row41157171546"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1972216221247"><a name="p1972216221247"></a><a name="p1972216221247"></a>headericon</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p177229221041"><a name="p177229221041"></a><a name="p177229221041"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p15722132218415"><a name="p15722132218415"></a><a name="p15722132218415"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p27221122445"><a name="p27221122445"></a><a name="p27221122445"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p172213223414"><a name="p172213223414"></a><a name="p172213223414"></a>Icon displayed before text input. This icon does not support click events. The supported icon formats are JPG, PNG, and SVG.</p>
</td>
</tr>
<tr id="row1416414649"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p5722162213413"><a name="p5722162213413"></a><a name="p5722162213413"></a>extend</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p47221221447"><a name="p47221221447"></a><a name="p47221221447"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p15722172212412"><a name="p15722172212412"></a><a name="p15722172212412"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1172212221745"><a name="p1172212221745"></a><a name="p1172212221745"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1872232213411"><a name="p1872232213411"></a><a name="p1872232213411"></a>Whether a text box can be extended. If the value of this attribute is set to <strong id="b073910572418"><a name="b073910572418"></a><a name="b073910572418"></a>true</strong>, the height of the text box can adapt to the text.</p>
</td>
</tr>
<tr id="row1273032304111"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1073002304114"><a name="p1073002304114"></a><a name="p1073002304114"></a>value<sup id="sup5397930164210"><a name="sup5397930164210"></a><a name="sup5397930164210"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p37316238419"><a name="p37316238419"></a><a name="p37316238419"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p773116239412"><a name="p773116239412"></a><a name="p773116239412"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1473162314411"><a name="p1473162314411"></a><a name="p1473162314411"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p20731162310415"><a name="p20731162310415"></a><a name="p20731162310415"></a>Content in a multi-line text box.</p>
</td>
</tr>
<tr id="row8191717132813"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p7201317102812"><a name="p7201317102812"></a><a name="p7201317102812"></a>showcounter<sup id="sup10332204922918"><a name="sup10332204922918"></a><a name="sup10332204922918"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p920141732817"><a name="p920141732817"></a><a name="p920141732817"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p15201317132812"><a name="p15201317132812"></a><a name="p15201317132812"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11201317192811"><a name="p11201317192811"></a><a name="p11201317192811"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p72081718281"><a name="p72081718281"></a><a name="p72081718281"></a>Whether to display the character counter for the text box. This attribute takes effect only when <strong id="b764616114321"><a name="b764616114321"></a><a name="b764616114321"></a>maxlength</strong> is set.</p>
</td>
</tr>
<tr id="row1765514319572"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p177221571244"><a name="p177221571244"></a><a name="p177221571244"></a>menuoptions<sup id="sup154944401542"><a name="sup154944401542"></a><a name="sup154944401542"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p8722157248"><a name="p8722157248"></a><a name="p8722157248"></a>Array&lt;<a href="#table83621954963">MenuOption</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p167221878414"><a name="p167221878414"></a><a name="p167221878414"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p197227713411"><a name="p197227713411"></a><a name="p197227713411"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p207221573417"><a name="p207221573417"></a><a name="p207221573417"></a>Menu options displayed after users click the <strong id="b21781315182119"><a name="b21781315182119"></a><a name="b21781315182119"></a>More</strong> button in the pop menu.</p>
</td>
</tr>
<tr id="row198351301534"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p95550281483"><a name="p95550281483"></a><a name="p95550281483"></a>autofocus<sup id="sup1775142235010"><a name="sup1775142235010"></a><a name="sup1775142235010"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1955511286485"><a name="p1955511286485"></a><a name="p1955511286485"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p6555192874812"><a name="p6555192874812"></a><a name="p6555192874812"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p3555142844817"><a name="p3555142844817"></a><a name="p3555142844817"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p135551628184820"><a name="p135551628184820"></a><a name="p135551628184820"></a>Whether to automatically obtain the focus.</p>
</td>
</tr>
<tr id="row1066516375317"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p16196311485"><a name="p16196311485"></a><a name="p16196311485"></a>selectedstart<sup id="sup151911922125019"><a name="sup151911922125019"></a><a name="sup151911922125019"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p126191631104819"><a name="p126191631104819"></a><a name="p126191631104819"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p7619163110489"><a name="p7619163110489"></a><a name="p7619163110489"></a>-1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1619123120488"><a name="p1619123120488"></a><a name="p1619123120488"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p9619113118488"><a name="p9619113118488"></a><a name="p9619113118488"></a>Start position for text selection.</p>
</td>
</tr>
<tr id="row81412785317"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p42301334184813"><a name="p42301334184813"></a><a name="p42301334184813"></a>selectedend<sup id="sup759182155017"><a name="sup759182155017"></a><a name="sup759182155017"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1523013444810"><a name="p1523013444810"></a><a name="p1523013444810"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1823053404815"><a name="p1823053404815"></a><a name="p1823053404815"></a>-1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p162301434104819"><a name="p162301434104819"></a><a name="p162301434104819"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p2023014344489"><a name="p2023014344489"></a><a name="p2023014344489"></a>End position for text selection.</p>
</td>
</tr>
<tr id="row15650913537"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p11428837134811"><a name="p11428837134811"></a><a name="p11428837134811"></a>softkeyboardenabled<sup id="sup135541120205017"><a name="sup135541120205017"></a><a name="sup135541120205017"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p18428837114816"><a name="p18428837114816"></a><a name="p18428837114816"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p124281037144812"><a name="p124281037144812"></a><a name="p124281037144812"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p842823714486"><a name="p842823714486"></a><a name="p842823714486"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1642873734813"><a name="p1642873734813"></a><a name="p1642873734813"></a>Whether to display the soft keyboard during editing.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** MenuOption<sup>5+</sup> | Name | Type | Default Value | Mandatory | Description |
| -------------------------------- | ----------------------- | ----- | ---- | ---------------------------------------- |
| placeholder | string | - | No | Content of the hint text. |
| maxlength | number | - | No | Maximum number of characters that can be entered in the multi-line text box. |
| headericon | string | - | No | Icon displayed before text input. This icon does not support click events. The supported icon formats are JPG, PNG, and SVG.|
| extend | boolean | false | No | Whether a text box can be extended. If the value of this attribute is set to **true**, the height of the text box can adapt to the text. |
| value<sup>5+</sup> | string | - | No | Content in a multi-line text box. |
| showcounter<sup>5+</sup> | boolean | false | No | Whether to display the character counter for the text box. This attribute takes effect only when **maxlength** is set. |
| menuoptions<sup>5+</sup> | Array&lt;MenuOption&gt; | - | No | Menu options displayed after users click the **More** button. |
| autofocus<sup>6+</sup> | boolean | false | No | Whether to automatically obtain focus. |
| selectedstart<sup>6+</sup> | number | -1 | No | Start position for text selection. |
| selectedend<sup>6+</sup> | number | -1 | No | End position for text selection. |
| softkeyboardenabled<sup>6+</sup> | boolean | true | No | Whether to display the soft keyboard during editing. |
<a name="table83621954963"></a> **Table 1** MenuOption<sup>5+</sup>
<table><thead align="left"><tr id="row536212545619"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p143621541967"><a name="p143621541967"></a><a name="p143621541967"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p936215541620"><a name="p936215541620"></a><a name="p936215541620"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p23626541665"><a name="p23626541665"></a><a name="p23626541665"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5362254461"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p33631541265"><a name="p33631541265"></a><a name="p33631541265"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p536311543619"><a name="p536311543619"></a><a name="p536311543619"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p73631954762"><a name="p73631954762"></a><a name="p73631954762"></a>Path of the icon for a menu option.</p>
</td>
</tr>
<tr id="row136319547613"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p12363654367"><a name="p12363654367"></a><a name="p12363654367"></a>content</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p1936312549617"><a name="p1936312549617"></a><a name="p1936312549617"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1036311548616"><a name="p1036311548616"></a><a name="p1036311548616"></a>Text content in a menu option.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section182794053"></a> | Name | Type | Description |
| ------- | ------ | ----------- |
| icon | string | Path of the icon for a menu option.|
| content | string | Text content of a menu option.|
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table14588121079"></a> ## Styles
<table><thead align="left"><tr id="row3588182975"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p2588112873"><a name="p2588112873"></a><a name="p2588112873"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="14.1985801419858%" id="mcps1.1.6.1.2"><p id="p18588321876"><a name="p18588321876"></a><a name="p18588321876"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="20.247975202479754%" id="mcps1.1.6.1.3"><p id="p1588132673"><a name="p1588132673"></a><a name="p1588132673"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="5.23947605239476%" id="mcps1.1.6.1.4"><p id="p3588192276"><a name="p3588192276"></a><a name="p3588192276"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="37.1962803719628%" id="mcps1.1.6.1.5"><p id="p55881121575"><a name="p55881121575"></a><a name="p55881121575"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row45881726713"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1588182874"><a name="p1588182874"></a><a name="p1588182874"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p8588725714"><a name="p8588725714"></a><a name="p8588725714"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p13588521677"><a name="p13588521677"></a><a name="p13588521677"></a>#e6000000</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p11588112272"><a name="p11588112272"></a><a name="p11588112272"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p17588923718"><a name="p17588923718"></a><a name="p17588923718"></a>Text color of the multi-line text box.</p>
</td>
</tr>
<tr id="row858822573"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p25881521973"><a name="p25881521973"></a><a name="p25881521973"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p13588629717"><a name="p13588629717"></a><a name="p13588629717"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p15588321719"><a name="p15588321719"></a><a name="p15588321719"></a>16px</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p05899216712"><a name="p05899216712"></a><a name="p05899216712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p175891621973"><a name="p175891621973"></a><a name="p175891621973"></a>Font size of the multi-line text box. </p>
</td>
</tr>
<tr id="row14589724712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p155891921078"><a name="p155891921078"></a><a name="p155891921078"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p658922277"><a name="p658922277"></a><a name="p658922277"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p12589521713"><a name="p12589521713"></a><a name="p12589521713"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p155891121872"><a name="p155891121872"></a><a name="p155891121872"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p55894219719"><a name="p55894219719"></a><a name="p55894219719"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note13589162372"><a name="note13589162372"></a><a name="note13589162372"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p12589021175"><a name="p12589021175"></a><a name="p12589021175"></a>If the <strong id="b114871535165219"><a name="b114871535165219"></a><a name="b114871535165219"></a>config-changes</strong> tag of <strong id="b749317356521"><a name="b749317356521"></a><a name="b749317356521"></a>fontSize</strong> is configured for abilities in the <strong id="b3494193515215"><a name="b3494193515215"></a><a name="b3494193515215"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="row3589121375"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p95891321170"><a name="p95891321170"></a><a name="p95891321170"></a>placeholder-color</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p1058982376"><a name="p1058982376"></a><a name="p1058982376"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p9589726718"><a name="p9589726718"></a><a name="p9589726718"></a>#99000000</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p558914219710"><a name="p558914219710"></a><a name="p558914219710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p25896215710"><a name="p25896215710"></a><a name="p25896215710"></a>Color of the hint text in the multi-line text box. This attribute is available when the component type is set to <strong id="b1880264510313"><a name="b1880264510313"></a><a name="b1880264510313"></a>text</strong>, <strong id="b1980916451312"><a name="b1980916451312"></a><a name="b1980916451312"></a>email</strong>, <strong id="b7809144513311"><a name="b7809144513311"></a><a name="b7809144513311"></a>date</strong>, <strong id="b158107452319"><a name="b158107452319"></a><a name="b158107452319"></a>time</strong>, <strong id="b10811104511318"><a name="b10811104511318"></a><a name="b10811104511318"></a>number</strong>, or <strong id="b15811545130"><a name="b15811545130"></a><a name="b15811545130"></a>password</strong>.</p>
</td>
</tr>
<tr id="row1658911216712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p4589182976"><a name="p4589182976"></a><a name="p4589182976"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p18589122578"><a name="p18589122578"></a><a name="p18589122578"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p1058982179"><a name="p1058982179"></a><a name="p1058982179"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p1058917212710"><a name="p1058917212710"></a><a name="p1058917212710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p2058912778"><a name="p2058912778"></a><a name="p2058912778"></a>Font weight. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b780883514536"><a name="b780883514536"></a><a name="b780883514536"></a>text</strong> component.</p>
</td>
</tr>
<tr id="row45906217712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p115907212715"><a name="p115907212715"></a><a name="p115907212715"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p459015215711"><a name="p459015215711"></a><a name="p459015215711"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p4590172674"><a name="p4590172674"></a><a name="p4590172674"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p12590828720"><a name="p12590828720"></a><a name="p12590828720"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p17590721579"><a name="p17590721579"></a><a name="p17590721579"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> in the family is selected as the font for the text. </p>
</td>
</tr>
<tr id="row583415126314"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p18674104193019"><a name="p18674104193019"></a><a name="p18674104193019"></a>caret-color<sup id="sup628114393018"><a name="sup628114393018"></a><a name="sup628114393018"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="14.1985801419858%" headers="mcps1.1.6.1.2 "><p id="p13674194173010"><a name="p13674194173010"></a><a name="p13674194173010"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="20.247975202479754%" headers="mcps1.1.6.1.3 "><p id="p12674164113010"><a name="p12674164113010"></a><a name="p12674164113010"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="5.23947605239476%" headers="mcps1.1.6.1.4 "><p id="p5674114183020"><a name="p5674114183020"></a><a name="p5674114183020"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.1962803719628%" headers="mcps1.1.6.1.5 "><p id="p18674134153015"><a name="p18674134153015"></a><a name="p18674134153015"></a>Color of the input cursor.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section3892191911214"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. | Name | Type | Default Value | Mandatory | Description |
| ------------------------ | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | \#e6000000 | No | Text color of the multi-line text box. |
| font-size | &lt;length&gt; | 16px | No | Font size of the multi-line text box. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| placeholder-color | &lt;color&gt; | \#99000000 | No | Color of the hint text in the multi-line text box. This attribute is available when the component type is set to one of the following: text\|email\|date\|time\|number\|password. |
| font-weight | number \| string | normal | No | Font weight. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| caret-color<sup>6+</sup> | &lt;color&gt; | - | No | Color of the caret. |
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row18605132815610"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p768720297617"><a name="p768720297617"></a><a name="p768720297617"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p126881629369"><a name="p126881629369"></a><a name="p126881629369"></a>{ text: newText, lines: textLines, height: textHeight }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p56883296617"><a name="p56883296617"></a><a name="p56883296617"></a>Triggered when the input content changes. The input content, number of rows, and row height are obtained through the parameters.</p>
<div class="note" id="note42491433440"><a name="note42491433440"></a><a name="note42491433440"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1524933204418"><a name="p1524933204418"></a><a name="p1524933204418"></a>If you change the <strong id="b1292019401570"><a name="b1292019401570"></a><a name="b1292019401570"></a>value</strong> attribute directly, this event will not be triggered. <sup id="sup1674874183511"><a name="sup1674874183511"></a><a name="sup1674874183511"></a>5+</sup></p>
</div></div>
</td>
</tr>
<tr id="row122281128165410"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p3284165512920"><a name="p3284165512920"></a><a name="p3284165512920"></a>translate<sup id="sup1220715214307"><a name="sup1220715214307"></a><a name="sup1220715214307"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p112841555916"><a name="p112841555916"></a><a name="p112841555916"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p132842551198"><a name="p132842551198"></a><a name="p132842551198"></a>Triggered when users click the translate button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row286017313541"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p9677163420503"><a name="p9677163420503"></a><a name="p9677163420503"></a>share<sup id="sup107382026312"><a name="sup107382026312"></a><a name="sup107382026312"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p86771934155012"><a name="p86771934155012"></a><a name="p86771934155012"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1967743413507"><a name="p1967743413507"></a><a name="p1967743413507"></a>Triggered when users click the share button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row1143814381541"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p12601236205015"><a name="p12601236205015"></a><a name="p12601236205015"></a>search<sup id="sup7157178113113"><a name="sup7157178113113"></a><a name="sup7157178113113"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1626016369501"><a name="p1626016369501"></a><a name="p1626016369501"></a>{ value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1026053614504"><a name="p1026053614504"></a><a name="p1026053614504"></a>Triggered when users click the search button in the pop menu displayed after they select a text segment. The selected text content is returned.</p>
</td>
</tr>
<tr id="row144191735105415"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p1712579511"><a name="p1712579511"></a><a name="p1712579511"></a>optionselect<sup id="sup053512117315"><a name="sup053512117315"></a><a name="sup053512117315"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p07155775115"><a name="p07155775115"></a><a name="p07155775115"></a>{ index:optionIndex, value: selectedText }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1671157105114"><a name="p1671157105114"></a><a name="p1671157105114"></a>Triggered when users click a menu option in the pop menu displayed after they select a text segment. This event is valid only when the <strong id="b9972192992713"><a name="b9972192992713"></a><a name="b9972192992713"></a>menuoptions</strong> attribute is set. The option index and selected text content are returned.</p>
</td>
</tr>
<tr id="row11141826125316"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p17803157175014"><a name="p17803157175014"></a><a name="p17803157175014"></a>selectchange<sup id="sup774434715119"><a name="sup774434715119"></a><a name="sup774434715119"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p13803157185013"><a name="p13803157185013"></a><a name="p13803157185013"></a>{ start: number, end: number }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p4803155719505"><a name="p4803155719505"></a><a name="p4803155719505"></a>Triggered when the text selection changes.</p>
</td>
</tr>
</tbody>
</table>
## Method<a name="section47669296127"></a> ## Events
Methods in [Universal Methods](js-components-common-methods.md) are supported. In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
## Example Code<a name="section1224516501541"></a> | Name | Parameter | Description |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
| change | { text: newText, lines: textLines, height: textHeight } | Triggered when the input content changes. The input content, number of rows, and row height are obtained through the parameters.<br>Since API version 5, if you change the value attribute directly, this event will not be triggered.|
| translate<sup>5+</sup> | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned.|
| share<sup>5+</sup> | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned.|
| search<sup>5+</sup> | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned.|
| optionselect<sup>5+</sup> | { index:optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned.|
| selectchange<sup>6+</sup> | { start: number, end: number }| Triggered when the text selection changes. |
```
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<textarea id="textarea" class="textarea" extend="true" maxlength="20" <textarea id="textarea" class="textarea" extend="true" maxlength="20"
headericon="/common/navigation_menu1_icon.svg" placeholder="Please input text" headericon="/common/navigation_menu1_icon.svg" placeholder="Please input text"
...@@ -352,14 +87,14 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -352,14 +87,14 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</textarea> </textarea>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.textarea { .textarea {
placeholder-color: gray; placeholder-color: gray;
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -372,5 +107,4 @@ change(e){ ...@@ -372,5 +107,4 @@ change(e){
} }
``` ```
![](figures/000000.png) ![000000](figures/000000.png)
# toggle<a name="EN-US_TOPIC_0000001127125082"></a> # toggle
The **<toggle\>** component allows your user to select from a group of options and may display the selection result in real time. Generally, the option group consists of many toggles. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<toggle>** component allows your user to select from a group of options and may display the selection result in real time. Generally, the option group consists of many toggles.
## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
## Child Components
Not supported Not supported
## Attributes<a name="section2598341175212"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p2063810588455"><a name="p2063810588455"></a><a name="p2063810588455"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row128581827123812"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p158151581017"><a name="p158151581017"></a><a name="p158151581017"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p98151887118"><a name="p98151887118"></a><a name="p98151887118"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p78158817112"><a name="p78158817112"></a><a name="p78158817112"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p8638135854515"><a name="p8638135854515"></a><a name="p8638135854515"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1981514819118"><a name="p1981514819118"></a><a name="p1981514819118"></a>Text value of the toggle.</p>
</td>
</tr>
<tr id="row1314733811"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p14144703815"><a name="p14144703815"></a><a name="p14144703815"></a>checked</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p174104714389"><a name="p174104714389"></a><a name="p174104714389"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p174134719389"><a name="p174134719389"></a><a name="p174134719389"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p86381558144516"><a name="p86381558144516"></a><a name="p86381558144516"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p184114763819"><a name="p184114763819"></a><a name="p184114763819"></a>Whether the toggle is selected.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section3655917541"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table83631117191317"></a>
<table><thead align="left"><tr id="row336351719135"><th class="cellrowborder" valign="top" width="17.928207179282072%" id="mcps1.1.6.1.1"><p id="p736319179132"><a name="p736319179132"></a><a name="p736319179132"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="14.088591140885912%" id="mcps1.1.6.1.2"><p id="p736311741311"><a name="p736311741311"></a><a name="p736311741311"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="21.41785821417858%" id="mcps1.1.6.1.3"><p id="p836331716138"><a name="p836331716138"></a><a name="p836331716138"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.979302069793021%" id="mcps1.1.6.1.4"><p id="p836314176137"><a name="p836314176137"></a><a name="p836314176137"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="39.58604139586041%" id="mcps1.1.6.1.5"><p id="p10363151721312"><a name="p10363151721312"></a><a name="p10363151721312"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row203632017171314"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p8363111761310"><a name="p8363111761310"></a><a name="p8363111761310"></a>text-color</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p18363101741314"><a name="p18363101741314"></a><a name="p18363101741314"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p17456195124520"><a name="p17456195124520"></a><a name="p17456195124520"></a>#E5000000</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p18363317181316"><a name="p18363317181316"></a><a name="p18363317181316"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p2363151712139"><a name="p2363151712139"></a><a name="p2363151712139"></a>Text color of the toggle.</p>
</td>
</tr>
<tr id="row15363111781318"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p18363111712132"><a name="p18363111712132"></a><a name="p18363111712132"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p12364101716134"><a name="p12364101716134"></a><a name="p12364101716134"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p0364117101318"><a name="p0364117101318"></a><a name="p0364117101318"></a>16px</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p6364161719139"><a name="p6364161719139"></a><a name="p6364161719139"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p2364201716136"><a name="p2364201716136"></a><a name="p2364201716136"></a>Font size of the toggle.</p>
</td>
</tr>
<tr id="row1836411177134"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p11364161781315"><a name="p11364161781315"></a><a name="p11364161781315"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p133641917161317"><a name="p133641917161317"></a><a name="p133641917161317"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p1336415173138"><a name="p1336415173138"></a><a name="p1336415173138"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p536415173134"><a name="p536415173134"></a><a name="p536415173134"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p536491719137"><a name="p536491719137"></a><a name="p536491719137"></a>Whether the font size changes with the system's font size settings.</p>
<div class="note" id="note236431714138"><a name="note236431714138"></a><a name="note236431714138"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p6364161721312"><a name="p6364161721312"></a><a name="p6364161721312"></a>If the <strong id="b9631151853613"><a name="b9631151853613"></a><a name="b9631151853613"></a>config-changes</strong> tag of <strong id="b15641171817360"><a name="b15641171817360"></a><a name="b15641171817360"></a>fontSize</strong> is configured for abilities in the <strong id="b20644418103618"><a name="b20644418103618"></a><a name="b20644418103618"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="row736421781317"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p6364717181310"><a name="p6364717181310"></a><a name="p6364717181310"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p18364121761313"><a name="p18364121761313"></a><a name="p18364121761313"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p236413174139"><a name="p236413174139"></a><a name="p236413174139"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p153646178137"><a name="p153646178137"></a><a name="p153646178137"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p7364131711318"><a name="p7364131711318"></a><a name="p7364131711318"></a>Font style of the toggle.</p>
</td>
</tr>
<tr id="row636418171130"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p7364817161320"><a name="p7364817161320"></a><a name="p7364817161320"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p103641917161316"><a name="p103641917161316"></a><a name="p103641917161316"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p1436451761313"><a name="p1436451761313"></a><a name="p1436451761313"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p143641717171314"><a name="p143641717171314"></a><a name="p143641717171314"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p1736431716139"><a name="p1736431716139"></a><a name="p1736431716139"></a>Font weight of the toggle. For details, see <strong id="b738112421315"><a name="b738112421315"></a><a name="b738112421315"></a>font-weight</strong> of the <a href="js-components-basic-text.md#section5775351116">text</a> component.</p>
</td>
</tr>
<tr id="row53641817161320"><td class="cellrowborder" valign="top" width="17.928207179282072%" headers="mcps1.1.6.1.1 "><p id="p19364171718135"><a name="p19364171718135"></a><a name="p19364171718135"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="14.088591140885912%" headers="mcps1.1.6.1.2 "><p id="p336415178135"><a name="p336415178135"></a><a name="p336415178135"></a>&lt;string&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="21.41785821417858%" headers="mcps1.1.6.1.3 "><p id="p10365131761314"><a name="p10365131761314"></a><a name="p10365131761314"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="6.979302069793021%" headers="mcps1.1.6.1.4 "><p id="p2036581716132"><a name="p2036581716132"></a><a name="p2036581716132"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.58604139586041%" headers="mcps1.1.6.1.5 "><p id="p133656177131"><a name="p133656177131"></a><a name="p133656177131"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section3892191911214"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table101871711203115"></a>
<table><thead align="left"><tr id="row1718751111316"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row105681412318"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p18889152411316"><a name="p18889152411316"></a><a name="p18889152411316"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p138891924103112"><a name="p138891924103112"></a><a name="p138891924103112"></a>{ checked: isChecked }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1889002418312"><a name="p1889002418312"></a><a name="p1889002418312"></a>Triggered when the toggle is selected or unselected.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section520313404174"></a>
``` ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------- | ------- | ----- | ---- | ---------- |
| value | string | - | Yes | Text value of the toggle. |
| checked | boolean | false | No | Whether the toggle is selected.|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ----------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| text-color | &lt;color&gt; | \#E5000000 | No | Text color of the toggle. |
| font-size | &lt;length&gt; | 16px | No | Font size of the toggle. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| font-style | string | normal | No | Font style of the toggle. |
| font-weight | number \| string | normal | No | Font weight of the toggle. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| font-family | &lt;string&gt; | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
| ------ | ------------------------------- | -------------- |
| change | { checked: isChecked }| Triggered when the toggle is selected or unselected.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="flex-direction: column;"> <div style="flex-direction: column;">
<text class="margin">1. Multiple choice example</text> <text class="margin">1. Multiple choice example</text>
...@@ -184,46 +72,62 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -184,46 +72,62 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.margin { .margin {
margin: 7px; margin: 7px;
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
toggle_list: [ toggle_list: [
{ "id":"1001", "name":"Living room", "checked":true }, {
{ "id":"1002", "name":"Bedroom", "checked":false }, "id": "1001", "name": "Living room", "checked": true
{ "id":"1003", "name":"Second bedroom", "checked":false }, },
{ "id":"1004", "name":"Kitchen", "checked":false }, {
{ "id":"1005", "name":"Study", "checked":false }, "id": "1002", "name": "Bedroom", "checked": false
{ "id":"1006", "name":"Garden", "checked":false }, },
{ "id":"1007", "name":"Bathroom", "checked":false }, {
{ "id":"1008", "name":"Balcony", "checked":false }, "id": "1003", "name": "Second bedroom", "checked": false
], },
toggles: ["Living room","Bedroom","Kitchen","Study"], {
idx: "" "id": "1004", "name": "Kitchen", "checked": false
}, },
allclick(arg) { {
this.idx = arg "id": "1005", "name": "Study", "checked": false
}, },
allchange(e) { {
if (e.checked === true) { "id": "1006", "name": "Garden", "checked": false
for (var i = 0; i < this.toggle_list.length; i++) { },
if (this.toggle_list[i].id === this.idx) { {
this.toggle_list[i].checked = true "id": "1007", "name": "Bathroom", "checked": false
} else { },
this.toggle_list[i].checked = false {
"id": "1008", "name": "Balcony", "checked": false
},
],
toggles: ["Living room", "Bedroom", "Kitchen", "Study"],
idx: ""
},
allclick(arg) {
this.idx = arg;
},
allchange(e) {
if (e.checked != true) {
return;
}
for (var i = 0; i < this.toggle_list.length; i++) {
if (this.toggle_list[i].id === this.idx) {
this.toggle_list[i].checked = true;
} else {
this.toggle_list[i].checked = false;
}
} }
}
} }
}
} }
``` ```
![](figures/screenshot.png) ![screenshot](figures/screenshot.png)
# toolbar-item<a name="EN-US_TOPIC_0000001127125080"></a> # toolbar-item
The **<toolbar-item\>** component is the child component of **<toolbar\>** to display an operation option on the toolbar. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Child Component<a name="section9288143101012"></a> As a child component of **\<toolbar>**, the **\<toolbar-item>** component is used to display an operation option on the toolbar.
None
## Attributes<a name="section19217161499"></a> ## Child Components
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. Not supported
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ----- | ------ | ---- | ---- | ---------------------------------------- |
| value | string | - | Yes | Text content of the operation option. |
| icon | string | - | Yes | Icon image path, which is displayed on the option text. The value can be a local path. Supported image formats are PNG, JPG, and SVG.|
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1745453714917"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1345453714498"><a name="p1345453714498"></a><a name="p1345453714498"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p8454537164910"><a name="p8454537164910"></a><a name="p8454537164910"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p645511377498"><a name="p645511377498"></a><a name="p645511377498"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p10455637114917"><a name="p10455637114917"></a><a name="p10455637114917"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p18883831183010"><a name="p18883831183010"></a><a name="p18883831183010"></a>Text content of the operation option.</p>
</td>
</tr>
<tr id="row1937143418494"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p15372163494913"><a name="p15372163494913"></a><a name="p15372163494913"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p13726344494"><a name="p13726344494"></a><a name="p13726344494"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p937223417498"><a name="p937223417498"></a><a name="p937223417498"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p19372183413493"><a name="p19372183413493"></a><a name="p19372183413493"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p837212344498"><a name="p837212344498"></a><a name="p837212344498"></a>Icon image path, which is displayed on the option text. The value is a local path. Supported image formats are PNG, JPG, and SVG.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section184493015533"></a> ## Styles
Only the following style attributes are supported. Only the following styles are supported.
<a name="table1744514388541"></a> | Name | Type | Default Value | Mandatory | Description |
<table><thead align="left"><tr id="row1244614388545"><th class="cellrowborder" valign="top" width="17.98%" id="mcps1.1.6.1.1"><p id="a4e80fb5a797c4328af30d59e2c570c71"><a name="a4e80fb5a797c4328af30d59e2c570c71"></a><a name="a4e80fb5a797c4328af30d59e2c570c71"></a>Name</p> | ------------------- | ---------------------------------------- | ------------ | ---- | ---------------------------------------- |
</th> | color | &lt;color&gt; | \#e6000000 | No | Font color. |
<th class="cellrowborder" valign="top" width="15.82%" id="mcps1.1.6.1.2"><p id="a4238bd3a376645a3ad8498d3916ed6c8"><a name="a4238bd3a376645a3ad8498d3916ed6c8"></a><a name="a4238bd3a376645a3ad8498d3916ed6c8"></a>Type</p> | font-size | &lt;length&gt; | 16px | No | Font size. |
</th> | allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. |
<th class="cellrowborder" valign="top" width="12.379999999999999%" id="mcps1.1.6.1.3"><p id="a5ece9efc3a1d464a868f9557e4784a97"><a name="a5ece9efc3a1d464a868f9557e4784a97"></a><a name="a5ece9efc3a1d464a868f9557e4784a97"></a>Default Value</p> | font-style | string | normal | No | Font style. Available values are as follows:<br> - **normal**: standard font style<br>- **italic**: italic font style|
</th> | font-weight | number\|string | normal | No | Font weight. The number value must be an exact multiple of 100 ranging from 100 to 900. The default value is **400**. A larger value indicates a bigger weight. Available values of the string type are **lighter**, **normal**, **bold**, or **bolder**.|
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p19451142418147"><a name="p19451142418147"></a><a name="p19451142418147"></a>Mandatory</p> | text-decoration | string | none | No | Text decoration. Available values are as follows:<br>- **underline**: An underline is used.<br>- **line-through**: A strikethrough is used.<br>- **none**: The standard text is used.|
</th> | font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
<th class="cellrowborder" valign="top" width="46.300000000000004%" id="mcps1.1.6.1.5"><p id="a2454f35c1eef44b4bb681caaa3ce48fc"><a name="a2454f35c1eef44b4bb681caaa3ce48fc"></a><a name="a2454f35c1eef44b4bb681caaa3ce48fc"></a>Description</p> | background | &lt;linear-gradient&gt; | - | No | Background. This attribute supports [gradient styles](../arkui-js/js-components-common-gradient.md) only and is not compatible with **background-color** or **background-image**.|
</th> | background-color | &lt;color&gt; | - | No | Background color. |
</tr> | background-image | string | - | No | Background image. Currently, this attribute is not compatible with **background-color** or **background**. Both online and local image resources are supported.|
</thead> | background-size | - string<br>- &lt;length&gt; &lt;length&gt;<br>- &lt;percentage&gt; &lt;percentage&gt; | auto | No | Background image size.<br>- The **string** values are as follows:<br> - **contain**: Expands the image to the maximum size so that its height and width are fully applicable to the content area.<br> - **cover**: Extends the background image to a large enough size so that it completely covers the background area. Some parts of the image may not be displayed in the background area.<br> - **auto**: Retains the original aspect ratio of the image.<br>- The two **length** values are width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default.<br>- The two **\<percentage>** values are width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default. |
<tbody><tr id="row1968320716339"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p16782113422516"><a name="p16782113422516"></a><a name="p16782113422516"></a>color</p> | background-repeat | string | repeat | No | How a background image is repeatedly drawn. By default, a background image is repeated both horizontally and vertically.<br>- **repeat**: The image is repeated along the x-axis and y-axis at the same time.<br>- **repeat-x**: The image is repeated along the x-axis.<br>- **repeat-y**: The image is repeated along the y-axis.<br>- **no-repeat**: The image is not repeated.|
</td> | background-position | - string string<br>- &lt;length&gt; &lt;length&gt;<br>- &lt;percentage&gt; &lt;percentage&gt; | 0px 0px | No | Position of the background image.<br>- Using keywords: If only one keyword is specified, the other value is **center** by default. The two values define the horizontal position and vertical position, respectively.<br> - **left**: leftmost in the horizontal direction.<br> - **right**: rightmost in the horizontal direction.<br> - **top**: top in the vertical direction.<br> - **bottom**: bottom in the vertical direction.<br> - **center**: center position.<br>- Using **<length>**: The first value indicates the horizontal position, and the second value indicates the vertical position. For the upper left corner, the value is **0 0**. The unit is pixel. If only one value is specified, the other one is **50%**.<br>- Using **\<percentage>**: The first value indicates the horizontal position, and the second value indicates the vertical position. **0% 0%** indicates the upper left corner. **100% 100%** indicates the lower right corner. If only one value is specified, the other one is **50%**.<br>- Using both **\<percentage>** and **\<length>**.|
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p678210342255"><a name="p678210342255"></a><a name="p678210342255"></a>&lt;color&gt;</p> | 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. |
</td> | display | string | flex | No | Type of the box containing an element. Available values are as follows:<br>- **flex**: Flexible layout.<br>- **none**: The box is disabled.|
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p11782113462512"><a name="p11782113462512"></a><a name="p11782113462512"></a>#e6000000</p> | visibility | string | visible | No | Whether to display the box containing an element. A hidden box still occupies layout space. (To remove the box, set the **display** attribute to **none**.) Available values are as follows:<br>- **visible**: The element is visible.<br>- **hidden**: The box is hidden but still takes up space.<br>If both **visibility** and **display** are set, only **display** takes effect.|
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1945222451418"><a name="p1945222451418"></a><a name="p1945222451418"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p9782134122511"><a name="p9782134122511"></a><a name="p9782134122511"></a>Text color.</p>
</td>
</tr>
<tr id="row93711310173314"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p15365537102518"><a name="p15365537102518"></a><a name="p15365537102518"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p1636517375255"><a name="p1636517375255"></a><a name="p1636517375255"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p7365103717256"><a name="p7365103717256"></a><a name="p7365103717256"></a>16px</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1452152481418"><a name="p1452152481418"></a><a name="p1452152481418"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p336663712252"><a name="p336663712252"></a><a name="p336663712252"></a>Text size.</p>
</td>
</tr>
<tr id="row48601612153319"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p3376124017256"><a name="p3376124017256"></a><a name="p3376124017256"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p1437654010251"><a name="p1437654010251"></a><a name="p1437654010251"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p1376154072515"><a name="p1376154072515"></a><a name="p1376154072515"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1452132471420"><a name="p1452132471420"></a><a name="p1452132471420"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p1937615404253"><a name="p1937615404253"></a><a name="p1937615404253"></a>Whether the text size changes with the system's font size settings.</p>
</td>
</tr>
<tr id="row1421915113312"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p0781642162510"><a name="p0781642162510"></a><a name="p0781642162510"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p107816428255"><a name="p107816428255"></a><a name="p107816428255"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p17811342142514"><a name="p17811342142514"></a><a name="p17811342142514"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11452162417140"><a name="p11452162417140"></a><a name="p11452162417140"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p197817427251"><a name="p197817427251"></a><a name="p197817427251"></a>Text font style. Available values are as follows:</p>
<a name="ol3712173853714"></a><a name="ol3712173853714"></a><ol id="ol3712173853714"><li><strong id="b533925573911"><a name="b533925573911"></a><a name="b533925573911"></a>normal</strong>: standard font style</li><li><strong id="b12117205710391"><a name="b12117205710391"></a><a name="b12117205710391"></a>italic</strong>: italic font style</li></ol>
</td>
</tr>
<tr id="row1373417172335"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p9764174572513"><a name="p9764174572513"></a><a name="p9764174572513"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p37641045112510"><a name="p37641045112510"></a><a name="p37641045112510"></a>number|string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p1976434511252"><a name="p1976434511252"></a><a name="p1976434511252"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p24528247143"><a name="p24528247143"></a><a name="p24528247143"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p17641452258"><a name="p17641452258"></a><a name="p17641452258"></a>Text font weight. The number value must be an exact multiple of 100 ranging from 100 to 900. The default value is 400. A larger value indicates a bigger weight. Available values of the string type are <strong id="b1695811444515"><a name="b1695811444515"></a><a name="b1695811444515"></a>lighter</strong>, <strong id="b59669416457"><a name="b59669416457"></a><a name="b59669416457"></a>normal</strong>, <strong id="b896724144518"><a name="b896724144518"></a><a name="b896724144518"></a>bold</strong>, or <strong id="b196910415458"><a name="b196910415458"></a><a name="b196910415458"></a>bolder</strong>.</p>
</td>
</tr>
<tr id="row017015211338"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p1693494732511"><a name="p1693494732511"></a><a name="p1693494732511"></a>text-decoration</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p7934124713256"><a name="p7934124713256"></a><a name="p7934124713256"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p1493416479256"><a name="p1493416479256"></a><a name="p1493416479256"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p9452124171410"><a name="p9452124171410"></a><a name="p9452124171410"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p18934647142514"><a name="p18934647142514"></a><a name="p18934647142514"></a>Text decoration. Available values are as follows:</p>
<a name="ol280935211386"></a><a name="ol280935211386"></a><ol id="ol280935211386"><li><strong id="b113241833938"><a name="b113241833938"></a><a name="b113241833938"></a>underline</strong>: An underline is used.</li><li><strong id="b1838734735"><a name="b1838734735"></a><a name="b1838734735"></a>line-through</strong>: A strikethrough is used.</li><li><strong id="b1177036435"><a name="b1177036435"></a><a name="b1177036435"></a>none</strong>: The standard text is used.</li></ol>
</td>
</tr>
<tr id="row458624153320"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="p1543212507250"><a name="p1543212507250"></a><a name="p1543212507250"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="p1243215092510"><a name="p1243215092510"></a><a name="p1243215092510"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="p34321750192510"><a name="p34321750192510"></a><a name="p34321750192510"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1945217249142"><a name="p1945217249142"></a><a name="p1945217249142"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="p134322050162510"><a name="p134322050162510"></a><a name="p134322050162510"></a>Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text.</p>
</td>
</tr>
<tr id="row5132259115419"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a473248d0f1ad4a6b87934aab462b09ce"><a name="a473248d0f1ad4a6b87934aab462b09ce"></a><a name="a473248d0f1ad4a6b87934aab462b09ce"></a>background</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a7c54e775a6bf4bbea277ff8927cc4c13"><a name="a7c54e775a6bf4bbea277ff8927cc4c13"></a><a name="a7c54e775a6bf4bbea277ff8927cc4c13"></a>&lt;linear-gradient&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="a5bbca83860ff4086bba1bf5b8698e28c"><a name="a5bbca83860ff4086bba1bf5b8698e28c"></a><a name="a5bbca83860ff4086bba1bf5b8698e28c"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p845216243143"><a name="p845216243143"></a><a name="p845216243143"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="ad385002530a346f09c23e6745ca0e916"><a name="ad385002530a346f09c23e6745ca0e916"></a><a name="ad385002530a346f09c23e6745ca0e916"></a>This attribute supports <a href="js-components-common-gradient.md">Gradient Styles</a> only but is not compatible with <strong id="b0391974618"><a name="b0391974618"></a><a name="b0391974618"></a>background-color</strong> or <strong id="b740177766"><a name="b740177766"></a><a name="b740177766"></a>background-image</strong>.</p>
</td>
</tr>
<tr id="row1613225905418"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="af5c7b4fc3d8949b5aff81c5b49783259"><a name="af5c7b4fc3d8949b5aff81c5b49783259"></a><a name="af5c7b4fc3d8949b5aff81c5b49783259"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a3f45d99020c04479943ad07f262a591c"><a name="a3f45d99020c04479943ad07f262a591c"></a><a name="a3f45d99020c04479943ad07f262a591c"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="add693215147d46e59c859940cc4520e8"><a name="add693215147d46e59c859940cc4520e8"></a><a name="add693215147d46e59c859940cc4520e8"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p545218247144"><a name="p545218247144"></a><a name="p545218247144"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="acd48c077d9964749ae766636b8ada95c"><a name="acd48c077d9964749ae766636b8ada95c"></a><a name="acd48c077d9964749ae766636b8ada95c"></a>Background color.</p>
</td>
</tr>
<tr id="row20131459185410"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a9ebf9bd289374413a2834bab0e3b46d4"><a name="a9ebf9bd289374413a2834bab0e3b46d4"></a><a name="a9ebf9bd289374413a2834bab0e3b46d4"></a>background-image</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a46c151a9e45b4ffcb4c45dfcb93214bd"><a name="a46c151a9e45b4ffcb4c45dfcb93214bd"></a><a name="a46c151a9e45b4ffcb4c45dfcb93214bd"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="a8be7284eb5884350ba591183a67d4060"><a name="a8be7284eb5884350ba591183a67d4060"></a><a name="a8be7284eb5884350ba591183a67d4060"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1045212441415"><a name="p1045212441415"></a><a name="p1045212441415"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="aa236de4e56e349ff8c753d294e98abab"><a name="aa236de4e56e349ff8c753d294e98abab"></a><a name="aa236de4e56e349ff8c753d294e98abab"></a>Background image. Currently, this attribute is not compatible with <strong id="b13129246941242"><a name="b13129246941242"></a><a name="b13129246941242"></a>background-color</strong> or <strong id="b18855542241242"><a name="b18855542241242"></a><a name="b18855542241242"></a>background</strong>. Both online and local image resources are supported.</p>
</td>
</tr>
<tr id="row0131145914543"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a5def9eea1a2b42e9b040f0f898a2fcdf"><a name="a5def9eea1a2b42e9b040f0f898a2fcdf"></a><a name="a5def9eea1a2b42e9b040f0f898a2fcdf"></a>background-size</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><a name="uc9d67b59ab8c4f5d8f766deb0f8f657b"></a><a name="uc9d67b59ab8c4f5d8f766deb0f8f657b"></a><ul id="uc9d67b59ab8c4f5d8f766deb0f8f657b"><li>string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="a2d537661fce74b13acbcc7a95ea56f08"><a name="a2d537661fce74b13acbcc7a95ea56f08"></a><a name="a2d537661fce74b13acbcc7a95ea56f08"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p10452132414149"><a name="p10452132414149"></a><a name="p10452132414149"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="a0709b83d5c8e4b75b1f0bb42d913ac02"><a name="a0709b83d5c8e4b75b1f0bb42d913ac02"></a><a name="a0709b83d5c8e4b75b1f0bb42d913ac02"></a>Background image size.</p>
<a name="ub2423a2f8d96432f8c58c629288432c5"></a><a name="ub2423a2f8d96432f8c58c629288432c5"></a><ul id="ub2423a2f8d96432f8c58c629288432c5"><li>The <strong id="b1240813501139"><a name="b1240813501139"></a><a name="b1240813501139"></a>string</strong> values are as follows:<a name="uee8f5c89381a4ce682a5d557f8e558ee"></a><a name="uee8f5c89381a4ce682a5d557f8e558ee"></a><ul id="uee8f5c89381a4ce682a5d557f8e558ee"><li><strong id="b18294195114318"><a name="b18294195114318"></a><a name="b18294195114318"></a>contain</strong>: Expands the image to the maximum size so that the height and width of the image are applicable to the content area.</li><li><strong id="b10184452334"><a name="b10184452334"></a><a name="b10184452334"></a>cover</strong>: Extends the background image to a large enough size so that the background image completely covers the background area. Some parts of the image may not be displayed in the background area.</li><li><strong id="b14980752831"><a name="b14980752831"></a><a name="b14980752831"></a>auto</strong>: The original image width-height ratio is retained.</li></ul>
</li><li>The two <strong id="b57176531536"><a name="b57176531536"></a><a name="b57176531536"></a>&lt;length&gt;</strong> values are as follows:<p id="a5b969a49f8074aae96a12e4232e47c5d"><a name="a5b969a49f8074aae96a12e4232e47c5d"></a><a name="a5b969a49f8074aae96a12e4232e47c5d"></a>Width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to <strong id="b14228456634"><a name="b14228456634"></a><a name="b14228456634"></a>auto</strong> by default.</p>
</li><li>The two <strong id="b4995195613312"><a name="b4995195613312"></a><a name="b4995195613312"></a>&lt;percentage&gt;</strong> values are as follows:<p id="a19ef0a7986ce47f2b7fe614975e23cd9"><a name="a19ef0a7986ce47f2b7fe614975e23cd9"></a><a name="a19ef0a7986ce47f2b7fe614975e23cd9"></a>Width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to <strong id="b1633231830"><a name="b1633231830"></a><a name="b1633231830"></a>auto</strong> by default.</p>
</li></ul>
</td>
</tr>
<tr id="row2017552715511"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a8e820e26428c4e008a691a8fc8c23294"><a name="a8e820e26428c4e008a691a8fc8c23294"></a><a name="a8e820e26428c4e008a691a8fc8c23294"></a>background-repeat</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="ab9ca7eb1f0fc48a9a3fc08b88fe11338"><a name="ab9ca7eb1f0fc48a9a3fc08b88fe11338"></a><a name="ab9ca7eb1f0fc48a9a3fc08b88fe11338"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="abbb032e6786d43568f7eea7b29611821"><a name="abbb032e6786d43568f7eea7b29611821"></a><a name="abbb032e6786d43568f7eea7b29611821"></a>repeat</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p16452102413147"><a name="p16452102413147"></a><a name="p16452102413147"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="a64efc26d6e2c48a3a4032c71b8511085"><a name="a64efc26d6e2c48a3a4032c71b8511085"></a><a name="a64efc26d6e2c48a3a4032c71b8511085"></a>Repeating attribute of a background image. By default, a background image is repeated both horizontally and vertically.</p>
<a name="uee59e640d2304d56a0a5b396795a8cc5"></a><a name="uee59e640d2304d56a0a5b396795a8cc5"></a><ul id="uee59e640d2304d56a0a5b396795a8cc5"><li><strong id="b11277195719522"><a name="b11277195719522"></a><a name="b11277195719522"></a>repeat</strong>: Repeatedly draws images along the x-axis and y-axis at the same time.</li><li><strong id="b55279597525"><a name="b55279597525"></a><a name="b55279597525"></a>repeat-x</strong>: Repeatedly draws images along the x-axis.</li><li><strong id="b48462126535"><a name="b48462126535"></a><a name="b48462126535"></a>repeat-y</strong>: Repeatedly draws images along the y-axis.</li><li><strong id="b26935493141242"><a name="b26935493141242"></a><a name="b26935493141242"></a>no-repeat</strong>: The image is not drawn repeatedly.</li></ul>
</td>
</tr>
<tr id="row181756277552"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a60e011e34e6c4b04a1c86ac873087eed"><a name="a60e011e34e6c4b04a1c86ac873087eed"></a><a name="a60e011e34e6c4b04a1c86ac873087eed"></a>background-position</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><a name="u2fe0f6beda39428780ca525d6dca1b30"></a><a name="u2fe0f6beda39428780ca525d6dca1b30"></a><ul id="u2fe0f6beda39428780ca525d6dca1b30"><li>string string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="ad96af7b5874e476db4b4cf968156a633"><a name="ad96af7b5874e476db4b4cf968156a633"></a><a name="ad96af7b5874e476db4b4cf968156a633"></a>0px 0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p445222451420"><a name="p445222451420"></a><a name="p445222451420"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><a name="ub1e24d41a33d4560a6637f7a16ee5140"></a><a name="ub1e24d41a33d4560a6637f7a16ee5140"></a><ul id="ub1e24d41a33d4560a6637f7a16ee5140"><li>Using keywords: If only one keyword is specified, the other value is <strong id="b5511326814"><a name="b5511326814"></a><a name="b5511326814"></a>center</strong> by default. The two values define the horizontal position and vertical position, respectively.<a name="uac6e07c1eb0244d79eeed180658cb6c6"></a><a name="uac6e07c1eb0244d79eeed180658cb6c6"></a><ul id="uac6e07c1eb0244d79eeed180658cb6c6"><li><strong id="b1554311179414"><a name="b1554311179414"></a><a name="b1554311179414"></a>left</strong>: leftmost in the horizontal direction</li><li><strong id="b737612182417"><a name="b737612182417"></a><a name="b737612182417"></a>right</strong>: rightmost in the horizontal direction</li><li><strong id="b1720014193413"><a name="b1720014193413"></a><a name="b1720014193413"></a>top</strong>: top in the vertical direction</li><li><strong id="b18452201349"><a name="b18452201349"></a><a name="b18452201349"></a>bottom</strong>: bottom in the vertical direction</li><li><strong id="b3875520242"><a name="b3875520242"></a><a name="b3875520242"></a>center</strong>: center position</li></ul>
</li></ul>
<a name="ua495746d9777430c973a5ec607309ac4"></a><a name="ua495746d9777430c973a5ec607309ac4"></a><ul id="ua495746d9777430c973a5ec607309ac4"><li>Using <strong id="b269119211746"><a name="b269119211746"></a><a name="b269119211746"></a>&lt;length&gt;</strong>: The first value indicates the horizontal position, and the second value indicates the vertical position. <strong id="b25271122446"><a name="b25271122446"></a><a name="b25271122446"></a>0 0</strong> indicates the upper left corner. The unit is pixel. If only one value is specified, the other one is <strong id="b132172242416"><a name="b132172242416"></a><a name="b132172242416"></a>50%</strong>.</li><li>Using <strong id="b111066252046"><a name="b111066252046"></a><a name="b111066252046"></a>&lt;percentage&gt;</strong>: The first value indicates the horizontal position, and the second value indicates the vertical position. <strong id="b48948251842"><a name="b48948251842"></a><a name="b48948251842"></a>0% 0%</strong> indicates the upper left corner. <strong id="b2756102611419"><a name="b2756102611419"></a><a name="b2756102611419"></a>100% 100%</strong> indicates the lower right corner. If only one value is specified, the other one is <strong id="b5578927747"><a name="b5578927747"></a><a name="b5578927747"></a>50%</strong>.</li><li>Using both <strong id="b154178914941242"><a name="b154178914941242"></a><a name="b154178914941242"></a>&lt;percentage&gt;</strong> and <strong id="b16022437541242"><a name="b16022437541242"></a><a name="b16022437541242"></a>&lt;length&gt;</strong>.</li></ul>
</td>
</tr>
<tr id="row31751127165514"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a529a69841d634cdfa9637284412e5cf1"><a name="a529a69841d634cdfa9637284412e5cf1"></a><a name="a529a69841d634cdfa9637284412e5cf1"></a>opacity</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a0820f7d1c5b34d6eab999bd9dddfad6c"><a name="a0820f7d1c5b34d6eab999bd9dddfad6c"></a><a name="a0820f7d1c5b34d6eab999bd9dddfad6c"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="a35dd1b1eab3a421f9c95d512860d5bda"><a name="a35dd1b1eab3a421f9c95d512860d5bda"></a><a name="a35dd1b1eab3a421f9c95d512860d5bda"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p14523246147"><a name="p14523246147"></a><a name="p14523246147"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="a2e8d180f3c914356af72e679446f4ab5"><a name="a2e8d180f3c914356af72e679446f4ab5"></a><a name="a2e8d180f3c914356af72e679446f4ab5"></a>Opacity of an element. The value ranges from <strong id="b202809908441242"><a name="b202809908441242"></a><a name="b202809908441242"></a>0</strong> to <strong id="b99312114841242"><a name="b99312114841242"></a><a name="b99312114841242"></a>1</strong>. The value <strong id="b27854883241242"><a name="b27854883241242"></a><a name="b27854883241242"></a>1</strong> means opaque, and <strong id="b52017499041242"><a name="b52017499041242"></a><a name="b52017499041242"></a>0</strong> means completely transparent.</p>
</td>
</tr>
<tr id="row48391367556"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a2e53aab1be1043489c29919ab37c6ea4"><a name="a2e53aab1be1043489c29919ab37c6ea4"></a><a name="a2e53aab1be1043489c29919ab37c6ea4"></a>display</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a38fa4b64eff24ff0bbb4220fb9026d73"><a name="a38fa4b64eff24ff0bbb4220fb9026d73"></a><a name="a38fa4b64eff24ff0bbb4220fb9026d73"></a>string</p>
<p id="a951b8ea86c6c45f99c84c93d6675d800"><a name="a951b8ea86c6c45f99c84c93d6675d800"></a><a name="a951b8ea86c6c45f99c84c93d6675d800"></a></p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="add1e263e897d48a595bd7a7f81b2c0c1"><a name="add1e263e897d48a595bd7a7f81b2c0c1"></a><a name="add1e263e897d48a595bd7a7f81b2c0c1"></a>flex</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p134525242141"><a name="p134525242141"></a><a name="p134525242141"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="a677d3f5076894546a1fc1404af757f26"><a name="a677d3f5076894546a1fc1404af757f26"></a><a name="a677d3f5076894546a1fc1404af757f26"></a>Type of the box containing an element. Available values are as follows:</p>
<a name="u20b5cc7616974e9d804498df629c48f1"></a><a name="u20b5cc7616974e9d804498df629c48f1"></a><ul id="u20b5cc7616974e9d804498df629c48f1"><li><strong id="b45227321849"><a name="b45227321849"></a><a name="b45227321849"></a>flex</strong>: flexible layout</li><li><strong id="b53233482941242"><a name="b53233482941242"></a><a name="b53233482941242"></a>none</strong>: The box is disabled.</li></ul>
</td>
</tr>
<tr id="row1483963614553"><td class="cellrowborder" valign="top" width="17.98%" headers="mcps1.1.6.1.1 "><p id="a74fb259ecfff44c7b47f54b335255419"><a name="a74fb259ecfff44c7b47f54b335255419"></a><a name="a74fb259ecfff44c7b47f54b335255419"></a>visibility</p>
</td>
<td class="cellrowborder" valign="top" width="15.82%" headers="mcps1.1.6.1.2 "><p id="a9a50e36f1fb246b0b1c193437d9ac37a"><a name="a9a50e36f1fb246b0b1c193437d9ac37a"></a><a name="a9a50e36f1fb246b0b1c193437d9ac37a"></a>string</p>
<p id="ab6e40650e55d48f3b666dce48145f2bd"><a name="ab6e40650e55d48f3b666dce48145f2bd"></a><a name="ab6e40650e55d48f3b666dce48145f2bd"></a></p>
</td>
<td class="cellrowborder" valign="top" width="12.379999999999999%" headers="mcps1.1.6.1.3 "><p id="a98ed5a2ff4dc4e6596afb58eea00d9e5"><a name="a98ed5a2ff4dc4e6596afb58eea00d9e5"></a><a name="a98ed5a2ff4dc4e6596afb58eea00d9e5"></a>visible</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1345202471410"><a name="p1345202471410"></a><a name="p1345202471410"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="46.300000000000004%" headers="mcps1.1.6.1.5 "><p id="a25930a9fa4bd4b8896aacc24e5202575"><a name="a25930a9fa4bd4b8896aacc24e5202575"></a><a name="a25930a9fa4bd4b8896aacc24e5202575"></a>Whether to display the box containing an element. The invisible box occupies layout space. (To remove the box, set the <strong id="b202816196553"><a name="b202816196553"></a><a name="b202816196553"></a>display</strong> attribute to <strong id="b173519194554"><a name="b173519194554"></a><a name="b173519194554"></a>none</strong>.) Available values are as follows:</p>
<a name="u2395105022844e08854f4266096995ea"></a><a name="u2395105022844e08854f4266096995ea"></a><ul id="u2395105022844e08854f4266096995ea"><li><strong id="b977043610416"><a name="b977043610416"></a><a name="b977043610416"></a>visible</strong>: The box is visible.</li><li><strong id="b7611237443"><a name="b7611237443"></a><a name="b7611237443"></a>hidden</strong>: The box is hidden but still takes up space.</li></ul>
<div class="note" id="nca29d306d97b4fbdbfd735b6c9fb57a4"><a name="nca29d306d97b4fbdbfd735b6c9fb57a4"></a><a name="nca29d306d97b4fbdbfd735b6c9fb57a4"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="a5196ede3623d46bbb930bc6254a55b9e"><a name="a5196ede3623d46bbb930bc6254a55b9e"></a><a name="a5196ede3623d46bbb930bc6254a55b9e"></a>If both <strong id="b852218381745"><a name="b852218381745"></a><a name="b852218381745"></a>visibility</strong> and <strong id="b1452217381449"><a name="b1452217381449"></a><a name="b1452217381449"></a>display</strong> are set, only <strong id="b6523143812412"><a name="b6523143812412"></a><a name="b6523143812412"></a>display</strong> takes effect.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Events<a name="section571865310552"></a>
Events in [Universal Events](js-components-common-events.md) are supported. ## Events
## Method<a name="section568225514199"></a> The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
Not supported Not supported
## Example<a name="section1240714821316"></a>
``` ## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<toolbar style="position: fixed; bottom: 0px; "> <toolbar style="position : fixed; bottom : 0px;">
<toolbar-item icon='common/Icon/location.png' value='Option 1' > </toolbar-item> <toolbar-item icon='common/Icon/location.png' value='Option 1'></toolbar-item>
<toolbar-item icon='common/Icon/heart.png' value='Option 2'> </toolbar-item> <toolbar-item icon='common/Icon/heart.png' value='Option 2'></toolbar-item>
<toolbar-item icon='common/Icon/diamond.png' value='Option 3' > </toolbar-item> <toolbar-item icon='common/Icon/diamond.png' value='Option 3'></toolbar-item>
<toolbar-item icon='common/Icon/heart.png' value='Option 4' > </toolbar-item> <toolbar-item icon='common/Icon/heart.png' value='Option 4'></toolbar-item>
<toolbar-item icon='common/Icon/heart.png' value='Option 5' > </toolbar-item> <toolbar-item icon='common/Icon/heart.png' value='Option 5'></toolbar-item>
<toolbar-item icon='common/Icon/heart.png' value='Option 6'> </toolbar-item> <toolbar-item icon='common/Icon/heart.png' value='Option 6'></toolbar-item>
</toolbar> </toolbar>
``` ```
![](figures/progress-7.jpg) ![progress-7](figures/progress-7.jpg)
# toolbar<a name="EN-US_TOPIC_0000001173324631"></a> # toolbar
The **<toolbar\>** component provides a bar that is usually placed at the bottom of a page to display operation options for the page. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<toolbar>** component provides a bar that is usually placed at the bottom of a page to display operation options for the page.
## Required Permissions
None None
## Child Component<a name="section172027510456"></a>
Only the **<toolbar-item\>** component is supported. ## Child Components
>![](../../public_sys-resources/icon-note.gif) **NOTE:** Only the **\<toolbar-item>** component is supported.
>A maximum of five **<toolbar-item\>** components can be contained in a **<toolbar\>** component. If there are six or more, only the first four are displayed, and the rest items are hidden in the **More** list of the toolbar. Users can click **More** to view the hidden items.
>The list is displayed in the default style instead of a customized style set for the **<toolbar-item\>** component.
## Attributes<a name="section153601034618"></a> > **NOTE**
>
> A maximum of five **\<toolbar-item>** child components can be displayed in a **\<toolbar>** component. If there are six or more toolbar items, the first four are displayed, and the rest items are added to the **More** list of the toolbar. Users can click **More** to view the items. The list is displayed in the default style instead of the custom style set for the <toolbar-item> components.
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section1889052254711"></a> ## Attributes
Styles in [Universal Styles](js-components-common-styles.md) are supported. The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The **height** style is not supported. The height is fixed at 56px.
## Events<a name="section104349151916"></a> ## Styles
None The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
## Method<a name="section568225514199"></a> > **NOTE**
>
> The **height** style is not supported. The height is fixed at 56px.
None
## Example Code<a name="section1597982719103"></a> ## Events
Not supported
## Methods
Not supported
For details, see the [toolbar-item example code](js-components-basic-toolbar-item.md). ## Example
For details, see [Example in toolbar-item](../arkui-js/js-components-basic-toolbar-item.md).
# xcomponent # xcomponent
> **NOTE**<br> > **NOTE**
>
> This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
The **\<xcomponent>** displays the components to which the EGL/OpenGLES or media data is written. The **\<xcomponent>** displays the components to which the EGL/OpenGLES or media data is written.
......
# Image<a name="EN-US_TOPIC_0000001173164737"></a> # Image
**Image** allows you to add an image. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Attributes<a name="section1968021961113"></a> The **Image** object is an image on the canvas.
<a name="table1025010619328"></a>
<table><thead align="left"><tr id="row163667603219"><th class="cellrowborder" valign="top" width="21.73%" id="mcps1.1.6.1.1"><p id="p536646193210"><a name="p536646193210"></a><a name="p536646193210"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="22.41%" id="mcps1.1.6.1.2"><p id="p7366166163213"><a name="p7366166163213"></a><a name="p7366166163213"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="7.9799999999999995%" id="mcps1.1.6.1.3"><p id="p143661564327"><a name="p143661564327"></a><a name="p143661564327"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="11.73%" id="mcps1.1.6.1.4"><p id="p11366264324"><a name="p11366264324"></a><a name="p11366264324"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="36.15%" id="mcps1.1.6.1.5"><p id="p636619618325"><a name="p636619618325"></a><a name="p636619618325"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row936656193210"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.1.6.1.1 "><p id="p1436610643211"><a name="p1436610643211"></a><a name="p1436610643211"></a>src</p>
</td>
<td class="cellrowborder" valign="top" width="22.41%" headers="mcps1.1.6.1.2 "><p id="p4366156183210"><a name="p4366156183210"></a><a name="p4366156183210"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="7.9799999999999995%" headers="mcps1.1.6.1.3 "><p id="p193667616322"><a name="p193667616322"></a><a name="p193667616322"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="11.73%" headers="mcps1.1.6.1.4 "><p id="p636611610320"><a name="p636611610320"></a><a name="p636611610320"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.1.6.1.5 "><p id="p13366106173215"><a name="p13366106173215"></a><a name="p13366106173215"></a>Image resource path.</p>
</td>
</tr>
<tr id="row13366969325"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.1.6.1.1 "><p id="p13366136183210"><a name="p13366136183210"></a><a name="p13366136183210"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="22.41%" headers="mcps1.1.6.1.2 "><p id="p73668623216"><a name="p73668623216"></a><a name="p73668623216"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="7.9799999999999995%" headers="mcps1.1.6.1.3 "><p id="p8366206123215"><a name="p8366206123215"></a><a name="p8366206123215"></a>0px</p>
</td>
<td class="cellrowborder" valign="top" width="11.73%" headers="mcps1.1.6.1.4 "><p id="p636617633210"><a name="p636617633210"></a><a name="p636617633210"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.1.6.1.5 "><p id="p123661613324"><a name="p123661613324"></a><a name="p123661613324"></a>Image width.</p>
</td>
</tr>
<tr id="row103661365321"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.1.6.1.1 "><p id="p163663610321"><a name="p163663610321"></a><a name="p163663610321"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="22.41%" headers="mcps1.1.6.1.2 "><p id="p03673613324"><a name="p03673613324"></a><a name="p03673613324"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="7.9799999999999995%" headers="mcps1.1.6.1.3 "><p id="p113674614326"><a name="p113674614326"></a><a name="p113674614326"></a>0px</p>
</td>
<td class="cellrowborder" valign="top" width="11.73%" headers="mcps1.1.6.1.4 "><p id="p3367566327"><a name="p3367566327"></a><a name="p3367566327"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.1.6.1.5 "><p id="p43671663322"><a name="p43671663322"></a><a name="p43671663322"></a>Image height.</p>
</td>
</tr>
<tr id="row18346152013215"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.1.6.1.1 "><p id="p1033772416322"><a name="p1033772416322"></a><a name="p1033772416322"></a>onload</p>
</td>
<td class="cellrowborder" valign="top" width="22.41%" headers="mcps1.1.6.1.2 "><p id="p1337202419320"><a name="p1337202419320"></a><a name="p1337202419320"></a>Function</p>
</td>
<td class="cellrowborder" valign="top" width="7.9799999999999995%" headers="mcps1.1.6.1.3 "><p id="p137953293211"><a name="p137953293211"></a><a name="p137953293211"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="11.73%" headers="mcps1.1.6.1.4 "><p id="p153471320113217"><a name="p153471320113217"></a><a name="p153471320113217"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.1.6.1.5 "><p id="p7337142443214"><a name="p7337142443214"></a><a name="p7337142443214"></a>Called when an image is successfully loaded. This function has no parameter.</p>
</td>
</tr>
<tr id="row455917203329"><td class="cellrowborder" valign="top" width="21.73%" headers="mcps1.1.6.1.1 "><p id="p107821651123213"><a name="p107821651123213"></a><a name="p107821651123213"></a>onerror</p>
</td>
<td class="cellrowborder" valign="top" width="22.41%" headers="mcps1.1.6.1.2 "><p id="p147828514328"><a name="p147828514328"></a><a name="p147828514328"></a>Function</p>
</td>
<td class="cellrowborder" valign="top" width="7.9799999999999995%" headers="mcps1.1.6.1.3 "><p id="p19161175419328"><a name="p19161175419328"></a><a name="p19161175419328"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="11.73%" headers="mcps1.1.6.1.4 "><p id="p0559142083215"><a name="p0559142083215"></a><a name="p0559142083215"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.1.6.1.5 "><p id="p1778212512329"><a name="p1778212512329"></a><a name="p1778212512329"></a>Called when an image fails to be loaded. This function has no parameter.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section13457717134912"></a> ## Attributes
``` | Name | Type | Default Value | Mandatory | Description |
| ------- | -------------- | ---- | ---- | ----------------- |
| src | string | - | Yes | Image resource path. |
| width | &lt;length&gt; | 0px | No | Image width. |
| height | &lt;length&gt; | 0px | No | Image height. |
| onload | Function | - | No | Function called when an image is successfully loaded. This function has no parameter.|
| onerror | Function | - | No | Function called when an image fails to be loaded. This function has no parameter.|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div> <div>
<canvas ref="canvas" style="width: 500px; height: 500px; "></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; "></canvas>
</div> </div>
``` ```
``` ```js
//xxx.js // xxx.js
export default { export default {
onShow(){ onShow() {
const el =this.$refs.canvas const el = this.$refs.canvas;
var ctx =el.getContext('2d'); var ctx = el.getContext('2d');
var img = new Image(); var img = new Image();
img.src = 'common/images/example.jpg'; // It is recommended that the image be stored in the common directory.
img.onload = function() { img.src = 'common/images/example.jpg';
console.log('Image load success'); img.onload = function () {
ctx.drawImage(img, 0, 0, 360, 250); console.log('Image load success');
}; ctx.drawImage(img, 0, 0, 360, 250);
img.onerror = function() { };
console.log('Image load fail'); img.onerror = function () {
}; console.log('Image load fail');
} };
}
} }
``` ```
![](figures/1-9.png)
![1-9](figures/1-9.png)
# ImageBitmap<a name="EN-US_TOPIC_0000001181948861"></a> # ImageBitmap
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
>**ImageBitmap** is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. >
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **ImageBitmap** object is generated by the **transferToImageBitmap\(\)** method of the **OffscreenCanvas** and stores the pixel data rendered on the **OffscreenCanvas**.
## Attributes<a name="section661391987"></a> The **ImageBitmap** object is an object generated using the **transferToImageBitmap()** method of the **OffscreenCanvas** and stores the pixel data rendered on the **OffscreenCanvas**.
<a name="table67211828124016"></a>
<table><thead align="left"><tr id="row108577289405"><th class="cellrowborder" valign="top" width="22.872287228722872%" id="mcps1.1.4.1.1"><p id="p385742814403"><a name="p385742814403"></a><a name="p385742814403"></a>Name</p> ## Attributes
</th>
<th class="cellrowborder" valign="top" width="29.352935293529352%" id="mcps1.1.4.1.2"><p id="p19857192816408"><a name="p19857192816408"></a><a name="p19857192816408"></a>Type</p> | Name| Type| Description|
</th> | -------- | -------- | -------- |
<th class="cellrowborder" valign="top" width="47.774777477747776%" id="mcps1.1.4.1.3"><p id="p18573288402"><a name="p18573288402"></a><a name="p18573288402"></a>Description</p> | width | number | Pixel width of the **ImageBitmap** object.|
</th> | height | number | Pixel height of the **ImageBitmap** object.|
</tr>
</thead>
<tbody><tr id="row1085792824019"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p1485792815404"><a name="p1485792815404"></a><a name="p1485792815404"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p11857182804010"><a name="p11857182804010"></a><a name="p11857182804010"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p1785711281405"><a name="p1785711281405"></a><a name="p1785711281405"></a>Pixel width of the <strong id="b1722548101315"><a name="b1722548101315"></a><a name="b1722548101315"></a>ImageBitmap</strong> object.</p>
</td>
</tr>
<tr id="row3857132812406"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p88572283404"><a name="p88572283404"></a><a name="p88572283404"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p198571828114017"><a name="p198571828114017"></a><a name="p198571828114017"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p3857192844012"><a name="p3857192844012"></a><a name="p3857192844012"></a>Pixel height of the <strong id="b199991910181313"><a name="b199991910181313"></a><a name="b199991910181313"></a>ImageBitmap</strong> object.</p>
</td>
</tr>
</tbody>
</table>
# ImageData<a name="EN-US_TOPIC_0000001127125022"></a> # ImageData
**ImageData** stores pixel data rendered on a canvas. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Attribute<a name="section661391987"></a> The **ImageData** object is an object that stores pixel data rendered on a canvas.
<a name="table67211828124016"></a>
<table><thead align="left"><tr id="row108577289405"><th class="cellrowborder" valign="top" width="22.872287228722872%" id="mcps1.1.4.1.1"><p id="p385742814403"><a name="p385742814403"></a><a name="p385742814403"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="29.352935293529352%" id="mcps1.1.4.1.2"><p id="p19857192816408"><a name="p19857192816408"></a><a name="p19857192816408"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="47.774777477747776%" id="mcps1.1.4.1.3"><p id="p18573288402"><a name="p18573288402"></a><a name="p18573288402"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1085792824019"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p1485792815404"><a name="p1485792815404"></a><a name="p1485792815404"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p11857182804010"><a name="p11857182804010"></a><a name="p11857182804010"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p1785711281405"><a name="p1785711281405"></a><a name="p1785711281405"></a>Actual width of the rectangle on the canvas, in pixels.</p>
</td>
</tr>
<tr id="row3857132812406"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p88572283404"><a name="p88572283404"></a><a name="p88572283404"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p198571828114017"><a name="p198571828114017"></a><a name="p198571828114017"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p3857192844012"><a name="p3857192844012"></a><a name="p3857192844012"></a>Actual height of the rectangle on the canvas, in pixels.</p>
</td>
</tr>
<tr id="row178581628194020"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p38582289408"><a name="p38582289408"></a><a name="p38582289408"></a>data</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p28581328104010"><a name="p28581328104010"></a><a name="p28581328104010"></a>&lt;Uint8ClampedArray&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p085802844017"><a name="p085802844017"></a><a name="p085802844017"></a>A one-dimensional array of color values. The values range from 0 to 255.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section3302437114813"></a> ## Attributes
``` | Name | Type | Description |
| ------ | ------------------------- | ---------------------------- |
| width | number | Actual width of the rectangle on the canvas, in pixels. |
| height | number | Actual height of the rectangle on the canvas, in pixels. |
| data | &lt;Uint8ClampedArray&gt; | A one-dimensional array of color values. The values range from 0 to 255.|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div> <div>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
``` ```js
//xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
onShow() { onShow() {
...@@ -62,4 +41,3 @@ export default { ...@@ -62,4 +41,3 @@ export default {
} }
} }
``` ```
# Universal Attributes # Universal Attributes
> **NOTE**<br> > **NOTE**
>
> Universal attributes are supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version. > Universal attributes are supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Common Attributes ## Common Attributes
......
# Media Query<a name="EN-US_TOPIC_0000001173164721"></a> # Media Query
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
>- The **media** attribute uses the actual size, physical pixel, and screen resolution of the device by default. Do not confuse them with the configuration based on basic screen width 720 px. >
> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The **media** attribute uses the actual size, physical pixel, and screen resolution of the device by default. Do not confuse them with the configuration based on basic screen width 720 px.
Media query is widely used on mobile devices. You may need to frequently modify the application style based on the device type or specific features and device parameters \(such as the screen resolution\). To keep up with your requirements, the media query component provides the following features:
1. Allows you to design different layouts matching the device and application attributes. Media Query is widely used on mobile devices. You may need to modify the application style based on the device type or specific features and device parameters (such as the screen resolution). Specifically, media queries allow you to:
2. Synchronously updates the application page layouts when your screen changes dynamically \(for example, in the event of screen splitting or landscape/portrait orientation switching\).
## CSS Syntax Rules<a name="section168919480313"></a>
Use @media to import query statements. The rules are as follows: 1. Design a layout style based on the device and application attributes.
2. Update the page layout to adapt to dynamic screen changes (for example, screen splitting or switching between landscape and portrait modes).
## CSS Syntax Rules
Use **@media** to import query statements. The rule is as follows:
``` ```
@media [media-type] [and|not|only] [(media-feature)] { @media [media-type] [and|not|only] [(media-feature)] {
...@@ -18,258 +25,95 @@ Use @media to import query statements. The rules are as follows: ...@@ -18,258 +25,95 @@ Use @media to import query statements. The rules are as follows:
} }
``` ```
Examples: @media screen and (round-screen: true) { … }: The condition is met when the device screen is round.
@media screen and \(round-screen: true\) \{\} // The condition is met when the device screen is round. @media (max-height: 800) { … }: Range query. CSS level 3 is used.
@media \(max-height: 800\) \{\} // Range query. CSS level 3 is used. @media (height <= 800) { ... }: Range query. CSS level 4 is used, and the statement is equivalent to that of CSS level 3.
@media \(height <= 800\) \{ ... \} // Range query. CSS level 4 is used, and the statement is equivalent to that of CSS level 3. @media screen and (device-type: tv) or (resolution < 2) { ... }: Multi-condition query that contains the media type and multiple media features.
@media screen and \(device-type: tv\) or \(resolution < 2\) \{ ... \} // Multi-condition query that contains the media type and multiple media features.
## Referencing Resources on a Page<a name="section1993557745"></a> ## Referencing Resources on a Page
Use @import to import media query. The rule is as follows: Use **@import** to import a media query. The rule is as follows:
``` ```
@import url [media-type] [and|not|only] [(media-feature)]; @import url [media-type] [and|not|only] [(media-feature)];
``` ```
Sample code: Example:
``` ```
@import '../common/style.css' screen and (min-width: 600) and (max-width: 1200); @import '../common/style.css' screen and (min-width: 600) and (max-width: 1200);
``` ```
## Media Type<a name="section17366633144"></a>
<a name="table153618443914"></a>
<table><thead align="left"><tr id="row143684113916"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p0361541396"><a name="p0361541396"></a><a name="p0361541396"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p133684203912"><a name="p133684203912"></a><a name="p133684203912"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1736124173913"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p836144193919"><a name="p836144193919"></a><a name="p836144193919"></a>screen</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p19361415397"><a name="p19361415397"></a><a name="p19361415397"></a>Media query based on screen-related parameters</p>
</td>
</tr>
</tbody>
</table>
## Media Logical Operation<a name="section9949248948"></a>
Media logical operators \(and, or, not, and only\) are used to implement complex media query. They can also be combined using comma \(,\). The following table describes the operators.
**Table 1** Media logical operators
<a name="table885321414713"></a>
<table><thead align="left"><tr id="row68533142713"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p4853114372"><a name="p4853114372"></a><a name="p4853114372"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p8853131419715"><a name="p8853131419715"></a><a name="p8853131419715"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1485312143720"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2854914679"><a name="p2854914679"></a><a name="p2854914679"></a>and</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p16614211014"><a name="p16614211014"></a><a name="p16614211014"></a>The <strong id="b58531219133515"><a name="b58531219133515"></a><a name="b58531219133515"></a>and</strong> operator is used to combine multiple media features into a media query, in a logical AND operation. The query is valid only when all media features are true. It can also combine media types and media functions.</p>
<p id="p1985411145715"><a name="p1985411145715"></a><a name="p1985411145715"></a>For example, <strong id="b173711673169"><a name="b173711673169"></a><a name="b173711673169"></a>screen and (device-type: wearable) and (max-height: 600)</strong> indicates that the query is valid when the device is a wearable and the maximum height of the application is less than or equal to 600 pixels.</p>
</td>
</tr>
<tr id="row1185414146717"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p8854191414716"><a name="p8854191414716"></a><a name="p8854191414716"></a>not</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p203046566106"><a name="p203046566106"></a><a name="p203046566106"></a>The <strong id="b192160136403"><a name="b192160136403"></a><a name="b192160136403"></a>not</strong> operator is used to perform a logical negation for a media query. <strong id="b6400101184118"><a name="b6400101184118"></a><a name="b6400101184118"></a>true</strong> is returned if the query condition is not met. Otherwise, <strong id="b0448111994110"><a name="b0448111994110"></a><a name="b0448111994110"></a>false</strong> is returned. In a media query list, logical negation is performed only for the media query using the <strong id="b395945418471"><a name="b395945418471"></a><a name="b395945418471"></a>not</strong> operator.</p>
<p id="p156455001010"><a name="p156455001010"></a><a name="p156455001010"></a>For example, <strong id="b1652072344913"><a name="b1652072344913"></a><a name="b1652072344913"></a>not screen and (min-height: 50) and (max-height: 600)</strong> indicates that the query is valid when the height of the application is less than 50 pixels or greater than 600 pixels.</p>
<div class="note" id="note14802175917349"><a name="note14802175917349"></a><a name="note14802175917349"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p10802165913349"><a name="p10802165913349"></a><a name="p10802165913349"></a>You must specify the media type when using the <strong id="b98446326516"><a name="b98446326516"></a><a name="b98446326516"></a>not</strong> operator.</p>
</div></div>
</td>
</tr>
<tr id="row7854914278"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p285421418718"><a name="p285421418718"></a><a name="p285421418718"></a>only</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p052516221183"><a name="p052516221183"></a><a name="p052516221183"></a>The <strong id="b1440018175537"><a name="b1440018175537"></a><a name="b1440018175537"></a>only</strong> operator applies the selected style only when the entire expression is matched. It can be used to prevent ambiguity while some browsers of earlier versions are processing the statements containing both media types and media features. For example:</p>
<p id="p79641292049"><a name="p79641292049"></a><a name="p79641292049"></a>screen and (min-height: 50)</p>
<p id="p1291414473456"><a name="p1291414473456"></a><a name="p1291414473456"></a>The browsers of earlier versions would mislead this sentence into <strong id="b4962851171020"><a name="b4962851171020"></a><a name="b4962851171020"></a>screen</strong>, causing the fact that the specified style is applied when only the media type is matched. In this case, the <strong id="b1075418316593"><a name="b1075418316593"></a><a name="b1075418316593"></a>only</strong> operator can be used to avoid this problem.</p>
<div class="note" id="note38311047113516"><a name="note38311047113516"></a><a name="note38311047113516"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1831194717358"><a name="p1831194717358"></a><a name="p1831194717358"></a>You must specify the media type when using the <strong id="b33691344533"><a name="b33691344533"></a><a name="b33691344533"></a>only</strong> operator.</p>
</div></div>
</td>
</tr>
<tr id="row685471419718"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p885415141877"><a name="p885415141877"></a><a name="p885415141877"></a>,(comma)</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p102861117191212"><a name="p102861117191212"></a><a name="p102861117191212"></a>The comma operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true. The effect of a comma operator is equivalent to that of the <strong id="b6137112318212"><a name="b6137112318212"></a><a name="b6137112318212"></a>or</strong> operator.</p>
<p id="p9854131415710"><a name="p9854131415710"></a><a name="p9854131415710"></a>For example, <strong id="b581719430310"><a name="b581719430310"></a><a name="b581719430310"></a>screen and (min-height: 1000), (round-screen: true)</strong> evaluates to true when the application height is greater than or equal to 1000 pixels or the device screen is rounded.</p>
</td>
</tr>
<tr id="row88546141710"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p168543144714"><a name="p168543144714"></a><a name="p168543144714"></a>or</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p45834951417"><a name="p45834951417"></a><a name="p45834951417"></a>The <strong id="b345813341814"><a name="b345813341814"></a><a name="b345813341814"></a>or</strong> operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true.</p>
<p id="p385419141878"><a name="p385419141878"></a><a name="p385419141878"></a>For example, <strong id="b67899251713"><a name="b67899251713"></a><a name="b67899251713"></a>screen and (max-height: 1000) or (round-screen: true)</strong> evaluates to true when the application height is less than or equal to 1000 pixels or the device screen is rounded.</p>
</td>
</tr>
</tbody>
</table>
At MediaQuery Level 4, range query is imported so that you can use the operators including <=, \>=, <, and \> besides the max- and min-operators.
**Table 2** Media logical range operators
<a name="table1668215910289"></a>
<table><thead align="left"><tr id="row5683090285"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p468319912820"><a name="p468319912820"></a><a name="p468319912820"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p46831916284"><a name="p46831916284"></a><a name="p46831916284"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1468318918281"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p49711232172812"><a name="p49711232172812"></a><a name="p49711232172812"></a>&lt;=</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="en-us_topic_0000001173164721_p136831596288"><a name="en-us_topic_0000001173164721_p136831596288"></a><a name="en-us_topic_0000001173164721_p136831596288"></a>Less than or equal to, for example, screen and (50 &lt;= height).</p>
</td>
</tr>
<tr id="row1668311912810"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p116831991284"><a name="p116831991284"></a><a name="p116831991284"></a>&gt;=</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="en-us_topic_0000001173164721_p453664715285"><a name="en-us_topic_0000001173164721_p453664715285"></a><a name="en-us_topic_0000001173164721_p453664715285"></a>Greater than or equal to, for example, screen and (600 &gt;= height).</p>
</td>
</tr>
<tr id="row868311910281"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p146837922814"><a name="p146837922814"></a><a name="p146837922814"></a>&lt;</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="en-us_topic_0000001173164721_p3387258152815"><a name="en-us_topic_0000001173164721_p3387258152815"></a><a name="en-us_topic_0000001173164721_p3387258152815"></a>Less than, for example, screen and (50 &lt; height).</p>
</td>
</tr>
<tr id="row14896753202819"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p148971753172813"><a name="p148971753172813"></a><a name="p148971753172813"></a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="en-us_topic_0000001173164721_p10897195319286"><a name="en-us_topic_0000001173164721_p10897195319286"></a><a name="en-us_topic_0000001173164721_p10897195319286"></a>Greater than, for example, screen and (600 &gt; height).</p>
</td>
</tr>
</tbody>
</table>
## Media Features<a name="section192341841653"></a>
<a name="table108921335177"></a>
<table><thead align="left"><tr id="row4892113181716"><th class="cellrowborder" valign="top" width="49.96%" id="mcps1.1.3.1.1"><p id="p13892113101714"><a name="p13892113101714"></a><a name="p13892113101714"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="50.03999999999999%" id="mcps1.1.3.1.2"><p id="p1289210301711"><a name="p1289210301711"></a><a name="p1289210301711"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row489203101713"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p1889213191718"><a name="p1889213191718"></a><a name="p1889213191718"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p18892193111711"><a name="p18892193111711"></a><a name="p18892193111711"></a>Height of the display area on the application page.</p>
</td>
</tr>
<tr id="row689217301711"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p289217314178"><a name="p289217314178"></a><a name="p289217314178"></a>min-height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1889213312176"><a name="p1889213312176"></a><a name="p1889213312176"></a>Minimum height of the display area on the application page.</p>
</td>
</tr>
<tr id="row389273101712"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p889293191710"><a name="p889293191710"></a><a name="p889293191710"></a>max-height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1889214331718"><a name="p1889214331718"></a><a name="p1889214331718"></a>Maximum height of the display area on the application page.</p>
</td>
</tr>
<tr id="row18892153201712"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p689212320171"><a name="p689212320171"></a><a name="p689212320171"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p78925319176"><a name="p78925319176"></a><a name="p78925319176"></a>Width of the display area on the application page.</p>
</td>
</tr>
<tr id="row1689211313176"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p1089215321715"><a name="p1089215321715"></a><a name="p1089215321715"></a>min-width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1189363121716"><a name="p1189363121716"></a><a name="p1189363121716"></a>Minimum width of the display area on the application page.</p>
</td>
</tr>
<tr id="row1989311319174"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p208936381719"><a name="p208936381719"></a><a name="p208936381719"></a>max-width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p7893103161712"><a name="p7893103161712"></a><a name="p7893103161712"></a>Maximum width of the display area on the application page.</p>
</td>
</tr>
<tr id="row108937312176"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p089317321714"><a name="p089317321714"></a><a name="p089317321714"></a>resolution</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1334199154717"><a name="p1334199154717"></a><a name="p1334199154717"></a>Resolution of the device. The unit can be dpi, dppx, or dpcm.</p>
<a name="ul194277378472"></a><a name="ul194277378472"></a><ul id="ul194277378472"><li>dpi indicates the number of physical pixels per inch. 1 dpi ≈ 0.39 dpcm.</li><li>dpcm indicates the number of physical pixels per centimeter. 1 dpcm ≈ 2.54 dpi.</li><li>dppx indicates the number of physical pixels in each pixel. The unit is 96 px = 1 inch, which is different from the calculation method of the pixel unit on the page. 1 dppx = 96 dpi.</li></ul>
</td>
</tr>
<tr id="row17126854121812"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p1127175491814"><a name="p1127175491814"></a><a name="p1127175491814"></a>min-resolution</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p112735411187"><a name="p112735411187"></a><a name="p112735411187"></a>Minimum device resolution.</p>
</td>
</tr>
<tr id="row96981254171812"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p96992542188"><a name="p96992542188"></a><a name="p96992542188"></a>max-resolution</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p6699125451818"><a name="p6699125451818"></a><a name="p6699125451818"></a>Maximum device resolution.</p>
</td>
</tr>
<tr id="row03341955131819"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p173349555184"><a name="p173349555184"></a><a name="p173349555184"></a>orientation</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p9787195619207"><a name="p9787195619207"></a><a name="p9787195619207"></a>Screen orientation.</p>
<p id="p6781934164019"><a name="p6781934164019"></a><a name="p6781934164019"></a>Options are as follows:</p>
<a name="ul1570584418402"></a><a name="ul1570584418402"></a><ul id="ul1570584418402"><li><strong id="b2016814371471"><a name="b2016814371471"></a><a name="b2016814371471"></a>orientation: portrait</strong>: portrait screen orientation</li><li><strong id="b18780227184"><a name="b18780227184"></a><a name="b18780227184"></a>orientation: landscape</strong>: landscape screen orientation</li></ul>
</td>
</tr>
<tr id="row16484183812015"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p6485163892016"><a name="p6485163892016"></a><a name="p6485163892016"></a>aspect-ratio</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1587614152112"><a name="p1587614152112"></a><a name="p1587614152112"></a>Ratio of the width to the height of the display area on the application page.</p>
<p id="p10485138182013"><a name="p10485138182013"></a><a name="p10485138182013"></a>Example: <strong id="b1156626191620"><a name="b1156626191620"></a><a name="b1156626191620"></a>aspect-ratio:1/2</strong></p>
</td>
</tr>
<tr id="row1365523972016"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p165573922013"><a name="p165573922013"></a><a name="p165573922013"></a>min-aspect-ratio</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p565623919203"><a name="p565623919203"></a><a name="p565623919203"></a>Minimum ratio of the width to the height of the display area on the application page.</p>
</td>
</tr>
<tr id="row13168408209"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p1131644020200"><a name="p1131644020200"></a><a name="p1131644020200"></a>max-aspect-ratio</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p3316164032014"><a name="p3316164032014"></a><a name="p3316164032014"></a>Maximum ratio of the width to the height of the display area on the application page.</p>
</td>
</tr>
<tr id="row20982240192014"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p18982140142017"><a name="p18982140142017"></a><a name="p18982140142017"></a>device-height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1198254032010"><a name="p1198254032010"></a><a name="p1198254032010"></a>Height of the device.</p>
</td>
</tr>
<tr id="row3944152920226"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p494411291223"><a name="p494411291223"></a><a name="p494411291223"></a>min-device-height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p9944112915227"><a name="p9944112915227"></a><a name="p9944112915227"></a>Minimum height of the device.</p>
</td>
</tr>
<tr id="row10362830102215"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p436319306222"><a name="p436319306222"></a><a name="p436319306222"></a>max-device-height</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p5363230142216"><a name="p5363230142216"></a><a name="p5363230142216"></a>Maximum height of the device.</p>
</td>
</tr>
<tr id="row31411431152213"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p714219311224"><a name="p714219311224"></a><a name="p714219311224"></a>device-width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p114273117223"><a name="p114273117223"></a><a name="p114273117223"></a>Width of the device.</p>
</td>
</tr>
<tr id="row8465184718239"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p646515471232"><a name="p646515471232"></a><a name="p646515471232"></a>min-device-width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p44654479235"><a name="p44654479235"></a><a name="p44654479235"></a>Minimum width of the device.</p>
</td>
</tr>
<tr id="row98591247182319"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p1685964722310"><a name="p1685964722310"></a><a name="p1685964722310"></a>max-device-width</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p1085954720232"><a name="p1085954720232"></a><a name="p1085954720232"></a>Maximum width of the device.</p>
</td>
</tr>
<tr id="row12501138114319"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="p925213810436"><a name="p925213810436"></a><a name="p925213810436"></a>round-screen</p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p2252173810430"><a name="p2252173810430"></a><a name="p2252173810430"></a>Screen type. The value <strong id="b48688335141"><a name="b48688335141"></a><a name="b48688335141"></a>true</strong> indicates a circular screen, and <strong id="b1595424471412"><a name="b1595424471412"></a><a name="b1595424471412"></a>false</strong> indicates a non-circular screen.</p>
</td>
</tr>
<tr id="row5462165172517"><td class="cellrowborder" valign="top" width="49.96%" headers="mcps1.1.3.1.1 "><p id="a74279e95586943efad8e81aa02496d6d"><a name="a74279e95586943efad8e81aa02496d6d"></a><a name="a74279e95586943efad8e81aa02496d6d"></a>dark-mode<sup id="sup182210324279"><a name="sup182210324279"></a><a name="sup182210324279"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="50.03999999999999%" headers="mcps1.1.3.1.2 "><p id="p88509314207"><a name="p88509314207"></a><a name="p88509314207"></a>Whether the device is in dark mode. The value is <strong id="b535842285711"><a name="b535842285711"></a><a name="b535842285711"></a>true</strong> if the device is in dark mode and <strong id="b63668223573"><a name="b63668223573"></a><a name="b63668223573"></a>false</strong> otherwise.</p>
</td>
</tr>
</tbody>
</table>
## Sample Code<a name="section1018513818615"></a>
- Sample code of the common media feature is as follows:
``` ## Media Type
| Type | Description |
| ------ | -------------- |
| screen | Media query based on screen-related parameters.|
## Media Logical Operation
Media logical operators (and, or, not, and only) are used to implement complex media query. They can also be combined using comma (,). The following table describes the operators.
**Table 1** Media logical operators
| Type | Description |
| -------- | ---------------------------------------- |
| and | The **and** operator is used to combine multiple media features into a media query, in a logical AND operation. The query is valid only when all media features are true. It can also combine media types and media functions.<br>For example, **screen and (device-type: wearable) and (max-height: 600)** indicates that the query is valid when the device is a wearable and the maximum height of the application is less than or equal to 600 pixels.|
| not | The **not** operator is used to perform a logical negation for a media query. **true** is returned if the query condition is not met. Otherwise, **false** is returned. In a media query list, logical negation is performed only for the media query using the **not** operator.<br>For example, **not screen and (min-height: 50) and (max-height: 600)** indicates that the query is valid when the height of the application is less than 50 pixels or greater than 600 pixels.<br>You must specify the media type when using the **not** operator.|
| only | The **only** operator applies the selected style only when the entire expression is matched. It can be used to prevent ambiguity on browsers of earlier versions. The statements that contain both media types and media features produce ambiguity when they are received by some browsers of earlier versions. For example:<br>screen and (min-height: 50)<br>The browsers of earlier versions would mislead this sentence into **screen**, causing the fact that the specified style is applied when only the media type is matched. In this case, the **only** operator can be used to avoid this problem.<br>You must specify the media type when using the **only** operator.|
| ,(comma) | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true. The effect of a comma operator is equivalent to that of the **or** operator.<br>For example, **screen and (min-height: 1000), (round-screen: true)** evaluates to true when the application height is greater than or equal to 1000 pixels or the device screen is rounded.|
| or | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true.<br>For example, **screen and (max-height: 1000) or (round-screen: true)** evaluates to true when the application height is less than or equal to 1000 pixels or the device screen is rounded.|
At MediaQuery Level 4, range query is imported so that you can use the operators including &lt;=, &gt;=, &lt;, and &gt; besides the max- and min-operators.
**Table 2** Logical operators for range query
| Type | Description |
| ----- | ---------------------------------------- |
| &lt;= | Less than or equal to, for example, **screen and (50 <= height)**.|
| &gt;= | Greater than or equal to, for example, **screen and (height >= 600)**.|
| &lt; | Less than, for example, **screen and (50 < height)**.|
| &gt; | Greater than, for example, **screen and (600 > height)**.|
## Media Features
| Type | Description |
| ---------------------- | ---------------------------------------- |
| height | Height of the display area on the application page. |
| min-height | Minimum height of the display area on the application page. |
| max-height | Maximum height of the display area on the application page. |
| width | Width of the display area on the application page. |
| min-width | Minimum width of the display area on the application page. |
| max-width | Maximum width of the display area on the application page. |
| resolution | Resolution of the device. The unit can be dpi, dppx, or dpcm. Where:<br>- **dpi** indicates the number of physical pixels per inch. 1 dpi ≈ 0.39 dpcm.<br>- **dpcm** indicates the number of physical pixels per centimeter. 1 dpcm ≈ 2.54 dpi.<br>- **dppx** indicates the number of physical pixels in each pixel. The unit is 96 px = 1 inch, which is different from the calculation method of the pixel unit on the page. 1 dppx = 96 dpi.|
| min-resolution | Minimum device resolution. |
| max-resolution | Maximum device resolution. |
| orientation | Screen orientation.<br>Options are as follows:<br>- **orientation: portrait**: portrait screen orientation<br>- **orientation: landscape**: landscape screen orientation|
| aspect-ratio | Ratio of the width to the height of the display area on the application page.<br>Example: **aspect-ratio:1/2**|
| min-aspect-ratio | Minimum ratio of the width to the height of the display area on the application page. |
| max-aspect-ratio | Maximum ratio of the width to the height of the display area on the application page. |
| device-height | Height of the device. |
| min-device-height | Minimum height of the device. |
| max-device-height | Maximum height of the device. |
| device-width | Width of the device. |
| min-device-width | Minimum width of the device. |
| max-device-width | Maximum width of the device. |
| round-screen | Screen type. The value **true** indicates a circular screen, and **false** indicates a non-circular screen. |
| dark-mode<sup>6+</sup> | Whether the device is in dark mode. The value **true** means that the device is in dark mode, and **false** means the opposite. |
## Example
Sample code for the common media feature is as follows:
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div> <div>
<div class="container"> <div class="container">
...@@ -278,7 +122,7 @@ At MediaQuery Level 4, range query is imported so that you can use the operators ...@@ -278,7 +122,7 @@ At MediaQuery Level 4, range query is imported so that you can use the operators
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
width: 300px; width: 300px;
...@@ -300,4 +144,3 @@ At MediaQuery Level 4, range query is imported so that you can use the operators ...@@ -300,4 +144,3 @@ At MediaQuery Level 4, range query is imported so that you can use the operators
} }
} }
``` ```
# Universal Methods<a name="EN-US_TOPIC_0000001127284884"></a> # Universal Methods
After a component is assigned the **id** attribute, you can use the ID to obtain the component objects and call functions. > **NOTE**
>
## animate<a name="section16276192233016"></a> > This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
animate\( keyframes: Keyframes, options: Options\): void After a component is assigned the **id** attribute, you can use the ID to obtain the component objects and call methods on them.
- Name
## animate
<a name="table207325467357"></a>
<table><thead align="left"><tr id="row5732104653513"><th class="cellrowborder" valign="top" width="19.18%" id="mcps1.1.5.1.1"><p id="p117329469352"><a name="p117329469352"></a><a name="p117329469352"></a>Name</p> animate( keyframes: Keyframes, options: Options): void
</th>
<th class="cellrowborder" valign="top" width="17.119999999999997%" id="mcps1.1.5.1.2"><p id="p1973274653510"><a name="p1973274653510"></a><a name="p1973274653510"></a>Type</p> **Parameters**
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="p11732246113511"><a name="p11732246113511"></a><a name="p11732246113511"></a>Mandatory</p> | Name | Type | Mandatory | Description |
</th> | --------- | --------- | ---- | ------------------------------------ |
<th class="cellrowborder" valign="top" width="56.18%" id="mcps1.1.5.1.4"><p id="p97321467354"><a name="p97321467354"></a><a name="p97321467354"></a>Description</p> | keyframes | keyframes | Yes | Animation style. |
</th> | options | Options | Yes | Array of objects used to set animation attributes. For details, see **Options**.|
</tr>
</thead> **Table 1** keyframes
<tbody><tr id="row147321246193511"><td class="cellrowborder" valign="top" width="19.18%" headers="mcps1.1.5.1.1 "><p id="p8732046113512"><a name="p8732046113512"></a><a name="p8732046113512"></a>keyframes</p>
</td> | Name | Type | Description |
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.1.5.1.2 "><p id="p116741612411"><a name="p116741612411"></a><a name="p116741612411"></a><a href="#table13611943164319">keyframes</a></p> | ------ | ------------------ | -------------------------------------- |
</td> | frames | Array&lt;Style&gt; | Array of objects used to set animation attributes. For details, see **Style attributes**.|
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p87327464352"><a name="p87327464352"></a><a name="p87327464352"></a>Yes</p>
</td> **Table 2** Style attributes
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p1373214633517"><a name="p1373214633517"></a><a name="p1373214633517"></a>Sets the animation style.</p>
</td> | Name | Type | Default Value | Description |
</tr> | ------------------ | ---------------------------------------- | -------------------- | ---------------------------------------- |
<tr id="row915193384018"><td class="cellrowborder" valign="top" width="19.18%" headers="mcps1.1.5.1.1 "><p id="p1715163354018"><a name="p1715163354018"></a><a name="p1715163354018"></a>options</p> | width | number | - | Width set for the component during playback of the animation. |
</td> | height | number | - | Height set for the component during playback of the animation. |
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.1.5.1.2 "><p id="p12167331404"><a name="p12167331404"></a><a name="p12167331404"></a><a href="js-components-common-methods.md#table1519818133494">Options</a></p> | backgroundColor | &lt;color&gt; | none | Background color set for the component during playback of the animation. |
</td> | opacity | number | 1 | Opacity set for the component. The value ranges from 0 to 1. |
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p21683315407"><a name="p21683315407"></a><a name="p21683315407"></a>Yes</p> | backgroundPosition | string | - | The value format is **x y**, in percentage or pixels.<br>The first value indicates the horizontal position, and the second value indicates the vertical position.<br>If only one value is specified, the other value is **50%**.|
</td> | transformOrigin | string | 'center center' | Origin position of the transformed element.<br>The first value indicates the x-axis position. The value can be **left**, **center**, **right**, a length, or a percentage.<br>The second value indicates the y-axis position. The value can be **top**, **center**, **bottom**, a length, or a percentage.|
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p11199113144912"><a name="p11199113144912"></a><a name="p11199113144912"></a>Array of objects used to set animation attributes. For details, see <a href="#table703167514">Options</a>.</p> | transform | [Transform](../arkui-js/js-components-common-animation.md) | - | Transformation type set for a transformed element. |
</td> | offset | number | - | - The value of **offset** must be within (0.0, 1.0] and sorted in ascending order if it is provided.<br>- If there are only two frames, **offset** can be left empty.<br>- If there are more than two frames, **offset** is mandatory.|
</tr>
</tbody> **Table 3** Options
</table>
| Name | Type | Default Value | Description |
**Table 1** keyframes | ---------------------- | -------------------------- | ------ | ---------------------------------------- |
| duration | number | 0 | Duration for playing the animation, in milliseconds. |
<a name="table13611943164319"></a> | easing | string | linear | Time curve of the animation. For details about the supported types, see **Available values of the easing attribute**. |
<table><thead align="left"><tr id="row1336113436432"><th class="cellrowborder" valign="top" width="30.503050305030506%" id="mcps1.2.4.1.1"><p id="p7362144324319"><a name="p7362144324319"></a><a name="p7362144324319"></a>Attribute</p> | delay | number | 0 | Delay for the animation start. The default value indicates no delay. |
</th> | iterations | number \| string | 1 | Number of times the animation will be played. **number** indicates a fixed number of playback operations, and **Infinity** indicates an unlimited number of playback operations.|
<th class="cellrowborder" valign="top" width="26.642664266426646%" id="mcps1.2.4.1.2"><p id="p036214434433"><a name="p036214434433"></a><a name="p036214434433"></a>Type</p> | direction<sup>6+</sup> | string | normal | Mode of playing the animation.<br>**normal**: Plays the animation in forward loop mode.<br>**reverse**: Plays the animation in reverse loop mode.<br>**alternate**: Plays the animation in alternating loop mode. When the animation is played for an odd number of times, the playback is in forward direction. When the animation is played for an even number of times, the playback is in backward direction. <br>**alternate-reverse**: plays the animation in reverse alternating loop mode. When the animation is played for an odd number of times, the playback is in reverse direction. When the animation is played for an even number of times, the playback is in forward direction.|
</th> | fill | string | none | Start and end styles of the animation.<br>**none**: No style is applied to the target before or after the animation is executed.<br>**forwards**: The target keeps the state at the end of the animation (defined in the last key frame) after the animation is executed.<br>**backwards**<sup>6+</sup>: The animation uses the value defined in the first key frame during the **animation-delay**. When **animation-direction** is set to **normal** or **alternate**, the value in the **from** key frame is used. When **animation-direction** is set to **reverse** or **alternate-reverse**, the value in the **to** key frame is used.<br>**both**: The animation follows the **forwards** and **backwards** rules.|
<th class="cellrowborder" valign="top" width="42.85428542854285%" id="mcps1.2.4.1.3"><p id="p83621243114317"><a name="p83621243114317"></a><a name="p83621243114317"></a>Description</p>
</th> **Table 4** Available values of the easing attribute
</tr>
</thead> | Value | Description |
<tbody><tr id="row20362164374316"><td class="cellrowborder" valign="top" width="30.503050305030506%" headers="mcps1.2.4.1.1 "><p id="p6225171713440"><a name="p6225171713440"></a><a name="p6225171713440"></a>frames</p> | ---------------------------------------- | ---------------------------------------- |
</td> | linear | The animation speed keeps unchanged. |
<td class="cellrowborder" valign="top" width="26.642664266426646%" headers="mcps1.2.4.1.2 "><p id="p6362174354317"><a name="p6362174354317"></a><a name="p6362174354317"></a>Array&lt;Style&gt;</p> | ease-in | The animation starts at a low speed. **cubic-bezier(0.42, 0.0, 1.0, 1.0)**.|
</td> | ease-out | The animation ends at a low speed. **cubic-bezier(0.0, 0.0, 0.58, 1.0)**.|
<td class="cellrowborder" valign="top" width="42.85428542854285%" headers="mcps1.2.4.1.3 "><p id="p2036224318436"><a name="p2036224318436"></a><a name="p2036224318436"></a>Array of objects used to set animation attributes. For details about style attributes, see <a href="#table15168543143">Style attributes</a>.</p> | ease-in-out | The animation starts and ends at a low speed. **cubic-bezier(0.42, 0.0, 0.58, 1.0)**.|
</td> | friction | The animation uses the damping curve, **cubic-bezier(0.2, 0.0, 0.2, 1.0)**.|
</tr> | extreme-deceleration | The animation uses the extreme deceleration cubic-bezier curve (0.0, 0.0, 0.0, 1.0).|
</tbody> | sharp | The animation uses the sharp cubic-bezier curve (0.33, 0.0, 0.67, 1.0).|
</table> | rhythm | The animation uses the rhythm cubic-bezier curve (0.7, 0.0, 0.2, 1.0).|
| smooth | The animation uses the smooth cubic-bezier curve (0.4, 0.0, 0.4, 1.0).|
**Table 2** Style attributes | cubic-bezier(x1, y1, x2, y2) | You can customize an animation speed curve in the **cubic-bezier()** function. The x and y values of each input parameter must be between 0 and 1. |
| steps(number, step-position)<sup>6+</sup> | The animation uses the step curve.<br>The **number** must be set and only an integer is supported.<br>**step-position** is optional. It can be set to **start** or **end**. The default value is **end**.|
<a name="table15168543143"></a>
<table><thead align="left"><tr id="row13169194318413"><th class="cellrowborder" valign="top" width="22.91%" id="mcps1.2.5.1.1"><p id="p716934319412"><a name="p716934319412"></a><a name="p716934319412"></a>Name</p> **Return value**
</th> The **animation** attributes are as follows.
<th class="cellrowborder" valign="top" width="10.67%" id="mcps1.2.5.1.2"><p id="p1169943747"><a name="p1169943747"></a><a name="p1169943747"></a>Type</p>
</th> | Name | Type | Description |
<th class="cellrowborder" valign="top" width="24.52%" id="mcps1.2.5.1.3"><p id="p016914431944"><a name="p016914431944"></a><a name="p016914431944"></a>Default Value</p> | --------- | ------- | ---------------------------------------- |
</th> | finished | boolean | Read-only attribute, which indicates whether the animation playback is complete. |
<th class="cellrowborder" valign="top" width="41.9%" id="mcps1.2.5.1.4"><p id="p121698431749"><a name="p121698431749"></a><a name="p121698431749"></a>Description</p> | pending | boolean | Read-only attribute, which indicates whether the animation is waiting for the completion of other asynchronous operations (for example, start an animation with a delay).|
</th> | playState | string | Read-write attribute, which indicates the playback status of the animation:<br>- **idle**: The animation is not running (playback ended or not started).<br>- **running**: The animation is running.<br>- **paused**: The animation is paused.<br>- **finished**: Animation playback ends.|
</tr> | startTime | number | Read-write attribute, which indicates the animation start time. This attribute is similar to **delay** in the **options** attribute. |
</thead>
<tbody><tr id="row216917436416"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p7169194314415"><a name="p7169194314415"></a><a name="p7169194314415"></a>width</p> The **animation** methods are as follows.
</td>
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p1169114318415"><a name="p1169114318415"></a><a name="p1169114318415"></a>number</p> | Method | Parameter | Description |
</td> | ------- | ---- | ------- |
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p13169184311417"><a name="p13169184311417"></a><a name="p13169184311417"></a>-</p> | play | - | Plays the animation.|
</td> | finish | - | Ends the animation.|
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p10169124310419"><a name="p10169124310419"></a><a name="p10169124310419"></a>Width set for the component during playback of the animation.</p> | pause | - | Pauses the animation.|
</td> | cancel | - | Cancels the animation.|
</tr> | reverse | - | Plays the animation in reverse.|
<tr id="row14169243944"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p11169843247"><a name="p11169843247"></a><a name="p11169843247"></a>height</p>
</td> The **animation** events are as follows.
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p17169943549"><a name="p17169943549"></a><a name="p17169943549"></a>number</p>
</td> | Event | Description |
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p916914315414"><a name="p916914315414"></a><a name="p916914315414"></a>-</p> | ------------------ | -------- |
</td> | start<sup>6+</sup> | The animation starts. |
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p1116914431443"><a name="p1116914431443"></a><a name="p1116914431443"></a>Height set for the component during playback of the animation.</p> | cancel | The animation is forcibly canceled.|
</td> | finish | The animation playback is complete. |
</tr> | repeat | The animation repeats. |
<tr id="row1116914437411"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p19169194319412"><a name="p19169194319412"></a><a name="p19169194319412"></a>backgroundColor</p>
</td> **Example**
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p616918431944"><a name="p616918431944"></a><a name="p616918431944"></a>&lt;color&gt;</p> ```html
</td> <!-- xxx.hml -->
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p11691443346"><a name="p11691443346"></a><a name="p11691443346"></a>none</p> <div class="container">
</td> <div id="idName" class="box"></div>
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p14170174320411"><a name="p14170174320411"></a><a name="p14170174320411"></a>Background color set for the component during playback of the animation.</p> <div class="buttonBox">
</td> <button @click="start">
</tr> start
<tr id="row51701643441"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p10170243842"><a name="p10170243842"></a><a name="p10170243842"></a>opacity</p> </button>
</td> <button @click="cancel">
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p19170114316414"><a name="p19170114316414"></a><a name="p19170114316414"></a>number</p> cancels
</td> </button>
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p11701743249"><a name="p11701743249"></a><a name="p11701743249"></a>1</p> </div>
</td> </div>
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p8170243142"><a name="p8170243142"></a><a name="p8170243142"></a>Opacity set for the component. The value ranges from <strong id="b76363459372"><a name="b76363459372"></a><a name="b76363459372"></a>0</strong> to <strong id="b1964116457373"><a name="b1964116457373"></a><a name="b1964116457373"></a>1</strong>.</p> ```
</td>
</tr> ```css
<tr id="row18170243149"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p31702431445"><a name="p31702431445"></a><a name="p31702431445"></a>backgroundPosition</p> /* xxx.css */
</td> .container {
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p20170243143"><a name="p20170243143"></a><a name="p20170243143"></a>string</p> flex-direction: column;
</td> justify-content: center;
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p1017020431447"><a name="p1017020431447"></a><a name="p1017020431447"></a>-</p> align-items: center;
</td> width: 100%;
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p1217094313411"><a name="p1217094313411"></a><a name="p1217094313411"></a>The value format is <strong id="b49364643719"><a name="b49364643719"></a><a name="b49364643719"></a>x y</strong>, in percentage or pixels.</p> }
<p id="p61701543144"><a name="p61701543144"></a><a name="p61701543144"></a>The first value indicates the horizontal position, and the second value indicates the vertical position.</p> .box{
<p id="p917084315410"><a name="p917084315410"></a><a name="p917084315410"></a>If only one value is specified, the other value is <strong id="b2860446193717"><a name="b2860446193717"></a><a name="b2860446193717"></a>50%</strong> by default.</p> width: 200px;
</td> height: 200px;
</tr> background-color: #ff0000;
<tr id="row10170243447"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p10170243545"><a name="p10170243545"></a><a name="p10170243545"></a>transformOrigin</p> margin-top: 30px;
</td> }
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p1717018432049"><a name="p1717018432049"></a><a name="p1717018432049"></a>string</p> .buttonBox{
</td> margin-top: 30px;
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p11704431548"><a name="p11704431548"></a><a name="p11704431548"></a>'center center'</p> width: 250px;
</td> justify-content: space-between;
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p3170643446"><a name="p3170643446"></a><a name="p3170643446"></a>Origin position of the transformed element.</p> }
<p id="p817012431349"><a name="p817012431349"></a><a name="p817012431349"></a>The first value indicates the x-axis position. The value can be <strong id="b20914191218395"><a name="b20914191218395"></a><a name="b20914191218395"></a>left</strong>, <strong id="b16915141233913"><a name="b16915141233913"></a><a name="b16915141233913"></a>center</strong>, <strong id="b1591571233911"><a name="b1591571233911"></a><a name="b1591571233911"></a>right</strong>, a length, or a percentage.</p> button{
<p id="p13170144310411"><a name="p13170144310411"></a><a name="p13170144310411"></a>The second value indicates the y-axis position. The value can be <strong id="b15935411173916"><a name="b15935411173916"></a><a name="b15935411173916"></a>top</strong>, <strong id="b994031111394"><a name="b994031111394"></a><a name="b994031111394"></a>center</strong>, <strong id="b19411111163910"><a name="b19411111163910"></a><a name="b19411111163910"></a>bottom</strong>, a length, or a percentage.</p> background-color: #8e8b89;
</td> color: white;
</tr> width: 100px;
<tr id="row201701443642"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p1017094315419"><a name="p1017094315419"></a><a name="p1017094315419"></a>transform</p> height: 40px;
</td> font-size: 24px;
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p12170043049"><a name="p12170043049"></a><a name="p12170043049"></a><a href="js-components-common-animation.md#table28802443315">Transform</a></p> }
</td> ```
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p14171243748"><a name="p14171243748"></a><a name="p14171243748"></a>-</p>
</td> ```js
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><p id="p18171174315410"><a name="p18171174315410"></a><a name="p18171174315410"></a>Transformation type set for a transformed element.</p> // xxx.js
</td> import prompt from '@system.prompt';
</tr> export default{
<tr id="row181715431943"><td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.2.5.1.1 "><p id="p91710436416"><a name="p91710436416"></a><a name="p91710436416"></a>offset</p> data:{
</td> animation:'',
<td class="cellrowborder" valign="top" width="10.67%" headers="mcps1.2.5.1.2 "><p id="p317164312412"><a name="p317164312412"></a><a name="p317164312412"></a>number</p> },
</td> onInit(){
<td class="cellrowborder" valign="top" width="24.52%" headers="mcps1.2.5.1.3 "><p id="p1171154312414"><a name="p1171154312414"></a><a name="p1171154312414"></a>-</p> },
</td> onShow(){
<td class="cellrowborder" valign="top" width="41.9%" headers="mcps1.2.5.1.4 "><a name="ul1017119439418"></a><a name="ul1017119439418"></a><ul id="ul1017119439418"><li>The value of <strong id="b0754154863713"><a name="b0754154863713"></a><a name="b0754154863713"></a>offset</strong> must be within (0.0,1.0] and sorted in ascending order if it is provided.</li><li>If there are only two frames, <strong id="b10139164983712"><a name="b10139164983712"></a><a name="b10139164983712"></a>offset</strong> can be left empty.</li><li>If there are more than two frames, <strong id="b97100207390"><a name="b97100207390"></a><a name="b97100207390"></a>offset</strong> is mandatory.</li></ul> var options = {
</td> duration: 1500,
</tr> easing: 'friction',
</tbody> delay: 500,
</table> fill: 'forwards',
iterations: 2,
**Table 3** Options description direction: 'normal',
};
<a name="table703167514"></a> var frames = [
<table><thead align="left"><tr id="row2008161451"><th class="cellrowborder" valign="top" width="18.89%" id="mcps1.2.5.1.1"><p id="p604163517"><a name="p604163517"></a><a name="p604163517"></a>Name</p> {transform: {translate: '-120px -0px'}, opacity: 0.1, offset: 0.0},
</th> {transform: {translate: '120px 0px'}, opacity: 1.0, offset: 1.0}
<th class="cellrowborder" valign="top" width="27.560000000000002%" id="mcps1.2.5.1.2"><p id="p1207161254"><a name="p1207161254"></a><a name="p1207161254"></a>Type</p> ];
</th> this.animation = this.$element('idName').animate(frames, options);
<th class="cellrowborder" valign="top" width="18.22%" id="mcps1.2.5.1.3"><p id="p1200161752"><a name="p1200161752"></a><a name="p1200161752"></a>Default Value</p> // handle finish event
</th> this.animation.onfinish = function(){
<th class="cellrowborder" valign="top" width="35.33%" id="mcps1.2.5.1.4"><p id="p11111167510"><a name="p11111167510"></a><a name="p11111167510"></a>Description</p> prompt.showToast({
</th> message: "The animation is finished."
</tr> });
</thead> };
<tbody><tr id="row71161610512"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p151131617520"><a name="p151131617520"></a><a name="p151131617520"></a>duration</p> // handle cancel event
</td> this.animation.oncancel = function(){
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p17141617518"><a name="p17141617518"></a><a name="p17141617518"></a>number</p> prompt.showToast({
</td> message: "The animation is canceled."
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p611816450"><a name="p611816450"></a><a name="p611816450"></a>0</p> });
</td> };
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p1011161458"><a name="p1011161458"></a><a name="p1011161458"></a>Duration for playing the animation, in milliseconds.</p> // handle repeat event
</td> this.animation.onrepeat = function(){
</tr> prompt.showToast({
<tr id="row31121616517"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p1211316658"><a name="p1211316658"></a><a name="p1211316658"></a>easing</p> message: "The animation is repeated."
</td> });
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p101616757"><a name="p101616757"></a><a name="p101616757"></a>string</p> };
</td> },
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p91131618515"><a name="p91131618515"></a><a name="p91131618515"></a>linear</p> start(){
</td> this.animation.play();
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p1615165512"><a name="p1615165512"></a><a name="p1615165512"></a>Time curve of the animation. For details about the supported types, see <a href="#table12317161054">Available values of the easing attribute</a>.</p> },
</td> cancel(){
</tr> this.animation.cancel();
<tr id="row161816758"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p615163514"><a name="p615163514"></a><a name="p615163514"></a>delay</p> }
</td> }
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p8116161512"><a name="p8116161512"></a><a name="p8116161512"></a>number</p> ```
</td>
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p1111163514"><a name="p1111163514"></a><a name="p1111163514"></a>0</p> ![animationapi-4](figures/animationapi-4.gif)
</td>
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p131616659"><a name="p131616659"></a><a name="p131616659"></a>Delay for the animation start. The default value indicates no delay.</p> ## getBoundingClientRect
</td>
</tr> getBoundingClientRect(): \<Rect>
<tr id="row4117165514"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p61016252"><a name="p61016252"></a><a name="p61016252"></a>iterations</p>
</td>
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p152316953"><a name="p152316953"></a><a name="p152316953"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p18281617510"><a name="p18281617510"></a><a name="p18281617510"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p32201615513"><a name="p32201615513"></a><a name="p32201615513"></a>Number of times the animation will be played. <strong id="b1119019523812"><a name="b1119019523812"></a><a name="b1119019523812"></a>number</strong> indicates a fixed number of playback operations, and <strong id="b319110563816"><a name="b319110563816"></a><a name="b319110563816"></a>Infinity</strong> indicates an unlimited number of playback operations.</p>
</td>
</tr>
<tr id="row8215166510"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p182131611511"><a name="p182131611511"></a><a name="p182131611511"></a>direction<sup id="sup325161155"><a name="sup325161155"></a><a name="sup325161155"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p18215161656"><a name="p18215161656"></a><a name="p18215161656"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p1827167510"><a name="p1827167510"></a><a name="p1827167510"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p9281612515"><a name="p9281612515"></a><a name="p9281612515"></a>Mode of playing the animation.</p>
<p id="p132101617517"><a name="p132101617517"></a><a name="p132101617517"></a><strong id="b661265611817"><a name="b661265611817"></a><a name="b661265611817"></a>normal</strong>: Plays the animation in forward loop mode.</p>
<p id="p3215161154"><a name="p3215161154"></a><a name="p3215161154"></a><strong id="b315117564199"><a name="b315117564199"></a><a name="b315117564199"></a>reverse</strong>: Plays the animation in reverse loop mode.</p>
<p id="p1321816454"><a name="p1321816454"></a><a name="p1321816454"></a><strong id="b01883517209"><a name="b01883517209"></a><a name="b01883517209"></a>alternate</strong>: Plays the animation in alternating loop mode. When the animation is played for an odd number of times, the playback is in forward direction. When the animation is played for an even number of times, the playback is in backward direction. </p>
<p id="p22181618510"><a name="p22181618510"></a><a name="p22181618510"></a><strong id="b1122444132810"><a name="b1122444132810"></a><a name="b1122444132810"></a>alternate-reverse</strong>: Plays the animation in reverse-alternating loop mode. When the animation is played for an odd number of times, the playback is in backward direction. When the animation is played for an even number of times, the playback is in forward direction. </p>
</td>
</tr>
<tr id="row1229163512"><td class="cellrowborder" valign="top" width="18.89%" headers="mcps1.2.5.1.1 "><p id="p32111618513"><a name="p32111618513"></a><a name="p32111618513"></a>fill</p>
</td>
<td class="cellrowborder" valign="top" width="27.560000000000002%" headers="mcps1.2.5.1.2 "><p id="p622161515"><a name="p622161515"></a><a name="p622161515"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.2.5.1.3 "><p id="p1424162520"><a name="p1424162520"></a><a name="p1424162520"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="35.33%" headers="mcps1.2.5.1.4 "><p id="p102171619515"><a name="p102171619515"></a><a name="p102171619515"></a>Start and end styles of the animation.</p>
<p id="p14220167520"><a name="p14220167520"></a><a name="p14220167520"></a><strong id="b95102196241659"><a name="b95102196241659"></a><a name="b95102196241659"></a>none</strong>: No style is applied to the target before or after the animation is executed.</p>
<p id="p202916355"><a name="p202916355"></a><a name="p202916355"></a><strong id="b60720248341659"><a name="b60720248341659"></a><a name="b60720248341659"></a>forwards</strong>: The target keeps the state at the end of the animation (defined in the last key frame) after the animation is executed.</p>
<p id="p17211168516"><a name="p17211168516"></a><a name="p17211168516"></a><strong id="b46810291047"><a name="b46810291047"></a><a name="b46810291047"></a>backwards</strong><sup id="sup138811738182"><a name="sup138811738182"></a><a name="sup138811738182"></a>6+</sup>: The animation uses the value defined in the first key frame during the <strong id="b835517106516"><a name="b835517106516"></a><a name="b835517106516"></a>animation-delay</strong>. When <strong id="b133698551511"><a name="b133698551511"></a><a name="b133698551511"></a>animation-direction</strong> is set to <strong id="b2327558755"><a name="b2327558755"></a><a name="b2327558755"></a>normal</strong> or <strong id="b1599365910513"><a name="b1599365910513"></a><a name="b1599365910513"></a>alternate</strong>, the value in the <strong id="b451431119612"><a name="b451431119612"></a><a name="b451431119612"></a>from</strong> key frame is used. When <strong id="b167462211565"><a name="b167462211565"></a><a name="b167462211565"></a>animation-direction</strong> is set to <strong id="b122791361617"><a name="b122791361617"></a><a name="b122791361617"></a>reverse</strong> or <strong id="b63560395611"><a name="b63560395611"></a><a name="b63560395611"></a>alternate-reverse</strong>, the value in the <strong id="b19219491061"><a name="b19219491061"></a><a name="b19219491061"></a>to</strong> key frame is used.</p>
<p id="p13201614513"><a name="p13201614513"></a><a name="p13201614513"></a><strong id="b13700558762"><a name="b13700558762"></a><a name="b13700558762"></a>both</strong><sup id="sup1588111341817"><a name="sup1588111341817"></a><a name="sup1588111341817"></a>6+</sup>: The animation follows the <strong id="b693012181778"><a name="b693012181778"></a><a name="b693012181778"></a>forwards</strong> and <strong id="b991216202075"><a name="b991216202075"></a><a name="b991216202075"></a>backwards</strong> rules.</p>
</td>
</tr>
</tbody>
</table>
**Table 4** Available values of the easing attribute
<a name="table12317161054"></a>
<table><thead align="left"><tr id="row731161656"><th class="cellrowborder" valign="top" width="37.940000000000005%" id="mcps1.2.3.1.1"><p id="p1317161058"><a name="p1317161058"></a><a name="p1317161058"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="62.06%" id="mcps1.2.3.1.2"><p id="p163016458"><a name="p163016458"></a><a name="p163016458"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row7371610517"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p19313165510"><a name="p19313165510"></a><a name="p19313165510"></a>linear</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p163716759"><a name="p163716759"></a><a name="p163716759"></a>The animation speed keeps unchanged.</p>
</td>
</tr>
<tr id="row133616555"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p1320161259"><a name="p1320161259"></a><a name="p1320161259"></a>ease-in</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p531216355"><a name="p531216355"></a><a name="p531216355"></a>The animation starts at a low speed. <strong id="b378417512383"><a name="b378417512383"></a><a name="b378417512383"></a>cubic-bezier(0.42, 0.0, 1.0, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row2316163512"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p1036162513"><a name="p1036162513"></a><a name="p1036162513"></a>ease-out</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p14310161158"><a name="p14310161158"></a><a name="p14310161158"></a>The animation ends at a low speed. <strong id="b715465119387"><a name="b715465119387"></a><a name="b715465119387"></a>cubic-bezier(0.0, 0.0, 0.58, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row14314160513"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p7361613513"><a name="p7361613513"></a><a name="p7361613513"></a>ease-in-out</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p194111615511"><a name="p194111615511"></a><a name="p194111615511"></a>The animation starts and ends at a low speed. <strong id="b1526650183812"><a name="b1526650183812"></a><a name="b1526650183812"></a>cubic-bezier(0.42, 0.0, 0.58, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row1415161357"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p5411166515"><a name="p5411166515"></a><a name="p5411166515"></a>friction</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p84316652"><a name="p84316652"></a><a name="p84316652"></a>Damping curve, <strong id="b2065404720381"><a name="b2065404720381"></a><a name="b2065404720381"></a>cubic-bezier(0.2, 0.0, 0.2, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row645164513"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p17416167514"><a name="p17416167514"></a><a name="p17416167514"></a>extreme-deceleration</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p164316255"><a name="p164316255"></a><a name="p164316255"></a>Extreme deceleration curve, <strong id="b84625466389"><a name="b84625466389"></a><a name="b84625466389"></a>cubic-bezier(0.0, 0.0, 0.0, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row11419161458"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p6411619517"><a name="p6411619517"></a><a name="p6411619517"></a>sharp</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p4414161554"><a name="p4414161554"></a><a name="p4414161554"></a>Sharp curve, <strong id="b13866045193817"><a name="b13866045193817"></a><a name="b13866045193817"></a>cubic-bezier(0.33, 0.0, 0.67, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row4461613518"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p20591614514"><a name="p20591614514"></a><a name="p20591614514"></a>rhythm</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p551416955"><a name="p551416955"></a><a name="p551416955"></a>Rhythm curve, <strong id="b1230104513388"><a name="b1230104513388"></a><a name="b1230104513388"></a>cubic-bezier(0.7, 0.0, 0.2, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row951716752"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p105181619510"><a name="p105181619510"></a><a name="p105181619510"></a>smooth</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p1251416256"><a name="p1251416256"></a><a name="p1251416256"></a>Smooth curve, <strong id="b8396144416387"><a name="b8396144416387"></a><a name="b8396144416387"></a>cubic-bezier(0.4, 0.0, 0.4, 1.0)</strong>.</p>
</td>
</tr>
<tr id="row954162052"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p15501614511"><a name="p15501614511"></a><a name="p15501614511"></a>cubic-bezier(x1, y1, x2, y2)</p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p195121611510"><a name="p195121611510"></a><a name="p195121611510"></a>You can customize an animation speed curve in the <strong id="b55061643143812"><a name="b55061643143812"></a><a name="b55061643143812"></a>cubic-bezier()</strong> function. The x and y values of each input parameter must be between 0 and 1.</p>
</td>
</tr>
<tr id="row1557166519"><td class="cellrowborder" valign="top" width="37.940000000000005%" headers="mcps1.2.3.1.1 "><p id="p175151613512"><a name="p175151613512"></a><a name="p175151613512"></a>steps(number, step-position)<sup id="sup165201613515"><a name="sup165201613515"></a><a name="sup165201613515"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="62.06%" headers="mcps1.2.3.1.2 "><p id="p17510161150"><a name="p17510161150"></a><a name="p17510161150"></a>Step curve.</p>
<p id="p1359161455"><a name="p1359161455"></a><a name="p1359161455"></a>The <strong id="b1284724173817"><a name="b1284724173817"></a><a name="b1284724173817"></a>number</strong> must be set and only an integer is supported.</p>
<p id="p15519162512"><a name="p15519162512"></a><a name="p15519162512"></a><strong id="b1076620494398"><a name="b1076620494398"></a><a name="b1076620494398"></a>step-position</strong> is optional. It can be set to <strong id="b8772949153918"><a name="b8772949153918"></a><a name="b8772949153918"></a>start</strong> or <strong id="b377374953915"><a name="b377374953915"></a><a name="b377374953915"></a>end</strong>. The default value is <strong id="b177731949163918"><a name="b177731949163918"></a><a name="b177731949163918"></a>end</strong>.</p>
</td>
</tr>
</tbody>
</table>
- Return values
The **animation** attributes are as follows.
<a name="table86771854185317"></a>
<table><thead align="left"><tr id="row206778544533"><th class="cellrowborder" valign="top" width="16.48%" id="mcps1.1.4.1.1"><p id="p18677115418539"><a name="p18677115418539"></a><a name="p18677115418539"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="20.46%" id="mcps1.1.4.1.2"><p id="p86775543533"><a name="p86775543533"></a><a name="p86775543533"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="63.06%" id="mcps1.1.4.1.3"><p id="p56771154115317"><a name="p56771154115317"></a><a name="p56771154115317"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5677654105311"><td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.1.4.1.1 "><p id="p2677654175313"><a name="p2677654175313"></a><a name="p2677654175313"></a>finished</p>
</td>
<td class="cellrowborder" valign="top" width="20.46%" headers="mcps1.1.4.1.2 "><p id="p367785419539"><a name="p367785419539"></a><a name="p367785419539"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="63.06%" headers="mcps1.1.4.1.3 "><p id="p8677254205313"><a name="p8677254205313"></a><a name="p8677254205313"></a>Read-only attribute, which indicates whether the animation playback is complete.</p>
</td>
</tr>
<tr id="row206771154145317"><td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.1.4.1.1 "><p id="p1967725418536"><a name="p1967725418536"></a><a name="p1967725418536"></a>pending</p>
</td>
<td class="cellrowborder" valign="top" width="20.46%" headers="mcps1.1.4.1.2 "><p id="p15677185415319"><a name="p15677185415319"></a><a name="p15677185415319"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="63.06%" headers="mcps1.1.4.1.3 "><p id="p11678185413534"><a name="p11678185413534"></a><a name="p11678185413534"></a>Read-only attribute, which indicates whether the animation is waiting for the completion of other asynchronous operations (for example, start an animation with a delay).</p>
</td>
</tr>
<tr id="row14678254135314"><td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.1.4.1.1 "><p id="p767855414537"><a name="p767855414537"></a><a name="p767855414537"></a>playState</p>
</td>
<td class="cellrowborder" valign="top" width="20.46%" headers="mcps1.1.4.1.2 "><p id="p46789542539"><a name="p46789542539"></a><a name="p46789542539"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="63.06%" headers="mcps1.1.4.1.3 "><p id="p767885475320"><a name="p767885475320"></a><a name="p767885475320"></a>Read-write attribute, which indicates the playback status of the animation:</p>
<a name="ul467812544531"></a><a name="ul467812544531"></a><ul id="ul467812544531"><li><strong id="b111155323383"><a name="b111155323383"></a><a name="b111155323383"></a>idle</strong>: The animation is not running (playback ended or not started).</li><li><strong id="b16562194011527"><a name="b16562194011527"></a><a name="b16562194011527"></a>running</strong>: The animation is running.</li><li><strong id="b1262634712524"><a name="b1262634712524"></a><a name="b1262634712524"></a>paused</strong>: The animation is paused.</li><li><strong id="b9892827103810"><a name="b9892827103810"></a><a name="b9892827103810"></a>finished</strong>: Animation playback ends.</li></ul>
</td>
</tr>
<tr id="row167835416535"><td class="cellrowborder" valign="top" width="16.48%" headers="mcps1.1.4.1.1 "><p id="p1467835495319"><a name="p1467835495319"></a><a name="p1467835495319"></a>startTime</p>
</td>
<td class="cellrowborder" valign="top" width="20.46%" headers="mcps1.1.4.1.2 "><p id="p5678554175311"><a name="p5678554175311"></a><a name="p5678554175311"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="63.06%" headers="mcps1.1.4.1.3 "><p id="p1667855415532"><a name="p1667855415532"></a><a name="p1667855415532"></a>Read-write attribute, which indicates the animation start time. This attribute is similar to <strong id="b20841169134017"><a name="b20841169134017"></a><a name="b20841169134017"></a>delay</strong> in the <strong id="b1684113915405"><a name="b1684113915405"></a><a name="b1684113915405"></a>options</strong> attribute.</p>
</td>
</tr>
</tbody>
</table>
Methods for animation
<a name="table186781154155316"></a>
<table><thead align="left"><tr id="row067825410537"><th class="cellrowborder" valign="top" width="30.86%" id="mcps1.1.4.1.1"><p id="p17678454155319"><a name="p17678454155319"></a><a name="p17678454155319"></a>Method</p>
</th>
<th class="cellrowborder" valign="top" width="10.58%" id="mcps1.1.4.1.2"><p id="p1967935445311"><a name="p1967935445311"></a><a name="p1967935445311"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="58.56%" id="mcps1.1.4.1.3"><p id="p10679154105313"><a name="p10679154105313"></a><a name="p10679154105313"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row116791054135314"><td class="cellrowborder" valign="top" width="30.86%" headers="mcps1.1.4.1.1 "><p id="p1967935416536"><a name="p1967935416536"></a><a name="p1967935416536"></a>play</p>
</td>
<td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.1.4.1.2 "><p id="p16679205416532"><a name="p16679205416532"></a><a name="p16679205416532"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="58.56%" headers="mcps1.1.4.1.3 "><p id="p967912541534"><a name="p967912541534"></a><a name="p967912541534"></a>Plays the animation.</p>
</td>
</tr>
<tr id="row146791354155316"><td class="cellrowborder" valign="top" width="30.86%" headers="mcps1.1.4.1.1 "><p id="p067911546534"><a name="p067911546534"></a><a name="p067911546534"></a>finish</p>
</td>
<td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.1.4.1.2 "><p id="p7679105413534"><a name="p7679105413534"></a><a name="p7679105413534"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="58.56%" headers="mcps1.1.4.1.3 "><p id="p12679135412530"><a name="p12679135412530"></a><a name="p12679135412530"></a>Ends the animation.</p>
</td>
</tr>
<tr id="row1679175419539"><td class="cellrowborder" valign="top" width="30.86%" headers="mcps1.1.4.1.1 "><p id="p17679354205318"><a name="p17679354205318"></a><a name="p17679354205318"></a>pause</p>
</td>
<td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.1.4.1.2 "><p id="p967975445319"><a name="p967975445319"></a><a name="p967975445319"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="58.56%" headers="mcps1.1.4.1.3 "><p id="p15679155425319"><a name="p15679155425319"></a><a name="p15679155425319"></a>Pauses the animation.</p>
</td>
</tr>
<tr id="row206791654125318"><td class="cellrowborder" valign="top" width="30.86%" headers="mcps1.1.4.1.1 "><p id="p12679135485318"><a name="p12679135485318"></a><a name="p12679135485318"></a>cancel</p>
</td>
<td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.1.4.1.2 "><p id="p14679154115317"><a name="p14679154115317"></a><a name="p14679154115317"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="58.56%" headers="mcps1.1.4.1.3 "><p id="p96791254105312"><a name="p96791254105312"></a><a name="p96791254105312"></a>Cancels the animation.</p>
</td>
</tr>
<tr id="row14679254155310"><td class="cellrowborder" valign="top" width="30.86%" headers="mcps1.1.4.1.1 "><p id="p967918543539"><a name="p967918543539"></a><a name="p967918543539"></a>reverse</p>
</td>
<td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.1.4.1.2 "><p id="p13680195475311"><a name="p13680195475311"></a><a name="p13680195475311"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="58.56%" headers="mcps1.1.4.1.3 "><p id="p66803548537"><a name="p66803548537"></a><a name="p66803548537"></a>Plays the animation in reverse.</p>
</td>
</tr>
</tbody>
</table>
Events for animation
<a name="table4680554175314"></a>
<table><thead align="left"><tr id="row1768055445313"><th class="cellrowborder" valign="top" width="20.79%" id="mcps1.1.3.1.1"><p id="p1968016548530"><a name="p1968016548530"></a><a name="p1968016548530"></a>Event</p>
</th>
<th class="cellrowborder" valign="top" width="79.21000000000001%" id="mcps1.1.3.1.2"><p id="p196801454195314"><a name="p196801454195314"></a><a name="p196801454195314"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1568010543534"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.1.3.1.1 "><p id="p1268075419535"><a name="p1268075419535"></a><a name="p1268075419535"></a>start<sup id="sup6680135435314"><a name="sup6680135435314"></a><a name="sup6680135435314"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="79.21000000000001%" headers="mcps1.1.3.1.2 "><p id="p5680554185315"><a name="p5680554185315"></a><a name="p5680554185315"></a>The animation starts.</p>
</td>
</tr>
<tr id="row96801854175315"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.1.3.1.1 "><p id="p86802054135311"><a name="p86802054135311"></a><a name="p86802054135311"></a>cancel</p>
</td>
<td class="cellrowborder" valign="top" width="79.21000000000001%" headers="mcps1.1.3.1.2 "><p id="p2068055455314"><a name="p2068055455314"></a><a name="p2068055455314"></a>The animation is forcibly canceled.</p>
</td>
</tr>
<tr id="row1268010544532"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.1.3.1.1 "><p id="p17680185445314"><a name="p17680185445314"></a><a name="p17680185445314"></a>finish</p>
</td>
<td class="cellrowborder" valign="top" width="79.21000000000001%" headers="mcps1.1.3.1.2 "><p id="p56802054195316"><a name="p56802054195316"></a><a name="p56802054195316"></a>The animation playback is complete.</p>
</td>
</tr>
<tr id="row1268016540533"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.1.3.1.1 "><p id="p15681165425316"><a name="p15681165425316"></a><a name="p15681165425316"></a>repeat</p>
</td>
<td class="cellrowborder" valign="top" width="79.21000000000001%" headers="mcps1.1.3.1.2 "><p id="p6681205418538"><a name="p6681205418538"></a><a name="p6681205418538"></a>The animation repeats.</p>
</td>
</tr>
</tbody>
</table>
- Example
```
<!-- xxx.hml -->
<div class="container">
<div id="idName" class="box"></div>
<div class="buttonBox">
<button @click="start">
start
</button>
<button @click="cancel">
cancels
</button>
</div>
</div>
```
```
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
}
.box{
width: 200px;
height: 200px;
background-color: #ff0000;
margin-top: 30px;
}
.buttonBox{
margin-top: 30px;
width: 250px;
justify-content: space-between;
}
button{
background-color: #8e8b89;
color: white;
width: 100px;
height: 40px;
font-size: 24px;
}
```
```
// xxx.js
import prompt from '@system.prompt';
export default{
data:{
animation:'',
},
onInit(){
},
onShow(){
var options = {
duration: 1500,
easing: 'friction',
delay: 500,
fill: 'forwards',
iterations: 2,
direction: 'normal',
};
var frames = [
{transform: {translate: '-120px -0px'}, opacity: 0.1, offset: 0.0},
{transform: {translate: '120px 0px'}, opacity: 1.0, offset: 1.0}
];
this.animation = this.$element('idName').animate(frames, options);
// handle finish event
this.animation.onfinish = function(){
prompt.showToast({
message: "The animation is finished."
});
};
// handle cancel event
this.animation.oncancel = function(){
prompt.showToast({
message: "The animation is canceled."
});
};
// handle repeat event
this.animation.onrepeat = function(){
prompt.showToast({
message: "The animation is repeated."
});
};
},
start(){
this.animation.play();
},
cancel(){
this.animation.cancel();
}
}
```
![](figures/animationapi-4.gif)
## getBoundingClientRect<a name="section11967381328"></a>
getBoundingClientRect\(\): [ <Rect\>](#table1650917111414)
Obtains the size of the element and its position relative to the window. Obtains the size of the element and its position relative to the window.
- Return values **Return value**
**Table 5** Rect attributes<sup>6+</sup>
<a name="table1650917111414"></a>
<table><thead align="left"><tr id="row950910718147"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p1850919701410"><a name="p1850919701410"></a><a name="p1850919701410"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p1250915711417"><a name="p1250915711417"></a><a name="p1250915711417"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p05091715144"><a name="p05091715144"></a><a name="p05091715144"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row550917701419"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p2050911714144"><a name="p2050911714144"></a><a name="p2050911714144"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p1550914717144"><a name="p1550914717144"></a><a name="p1550914717144"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p105091477141"><a name="p105091477141"></a><a name="p105091477141"></a>Width of an element.</p>
</td>
</tr>
<tr id="row450913719141"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p850919761418"><a name="p850919761418"></a><a name="p850919761418"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p135098712142"><a name="p135098712142"></a><a name="p135098712142"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p65099718144"><a name="p65099718144"></a><a name="p65099718144"></a>Height of an element.</p>
</td>
</tr>
<tr id="row155090751416"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p115093712147"><a name="p115093712147"></a><a name="p115093712147"></a>left</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p1051057171411"><a name="p1051057171411"></a><a name="p1051057171411"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1051016719148"><a name="p1051016719148"></a><a name="p1051016719148"></a>Offset between the left boundary of the element and the window.</p>
</td>
</tr>
<tr id="row351016710149"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p15101377145"><a name="p15101377145"></a><a name="p15101377145"></a>top</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p1151019710142"><a name="p1151019710142"></a><a name="p1151019710142"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p6510172148"><a name="p6510172148"></a><a name="p6510172148"></a>Offset between the upper boundary of the element and the window.</p>
</td>
</tr>
</tbody>
</table>
- Example
```
// xxx.js
var rect = this.$element('id').getBoundingClientRect();
console.info(`current element position is ${rect.left}, ${rect.top}`);
```
## createIntersectionObserver<a name="section7425195215615"></a>
createIntersectionObserver\(param?: ObserverParam):Observer
Gets notified of the visibility of an element on the current page.
- Name
<a name="table567561815123"></a>
<table><thead align="left"><tr id="row15675201881219"><th class="cellrowborder" valign="top" width="19.2%" id="mcps1.1.5.1.1"><p id="p126751318151215"><a name="p126751318151215"></a><a name="p126751318151215"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="17.1%" id="mcps1.1.5.1.2"><p id="p12675818131212"><a name="p12675818131212"></a><a name="p12675818131212"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="p9675111861212"><a name="p9675111861212"></a><a name="p9675111861212"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="56.18%" id="mcps1.1.5.1.4"><p id="p56751118111216"><a name="p56751118111216"></a><a name="p56751118111216"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row126751718121213"><td class="cellrowborder" valign="top" width="19.2%" headers="mcps1.1.5.1.1 "><p id="p46751418151217"><a name="p46751418151217"></a><a name="p46751418151217"></a>param</p>
</td>
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.1.5.1.2 "><p id="p176751018141220"><a name="p176751018141220"></a><a name="p176751018141220"></a><a href="#table1335524911817">ObserverParam</a></p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p1667561821211"><a name="p1667561821211"></a><a name="p1667561821211"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p116759187124"><a name="p116759187124"></a><a name="p116759187124"></a>Obtains the observer callback.</p>
</td>
</tr>
</tbody>
</table>
**Table 6** ObserverParam attributes<sup>6+</sup>
<a name="table1335524911817"></a>
<table><thead align="left"><tr id="row18355104917180"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p43551349141810"><a name="p43551349141810"></a><a name="p43551349141810"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p5355164914188"><a name="p5355164914188"></a><a name="p5355164914188"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p33551849111811"><a name="p33551849111811"></a><a name="p33551849111811"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1335512499188"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p143553491189"><a name="p143553491189"></a><a name="p143553491189"></a>ratios</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p183553494182"><a name="p183553494182"></a><a name="p183553494182"></a>Array&lt;number&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p153551949101819"><a name="p153551949101819"></a><a name="p153551949101819"></a>When the component is out of the range or is less than the range, the observer callback is triggered.</p>
</td>
</tr>
</tbody>
</table>
- Return values
**Table 7** Methods supported by the Observer object<sup>6+</sup>
<a name="table4506633141711"></a>
<table><thead align="left"><tr id="row4507163301712"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p55074331172"><a name="p55074331172"></a><a name="p55074331172"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p8507033151711"><a name="p8507033151711"></a><a name="p8507033151711"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p1650743315176"><a name="p1650743315176"></a><a name="p1650743315176"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row550783311177"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1050793319175"><a name="p1050793319175"></a><a name="p1050793319175"></a>observe</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p650713351713"><a name="p650713351713"></a><a name="p650713351713"></a>callback: function</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p750713361718"><a name="p750713361718"></a><a name="p750713361718"></a>Subscribes to events of the observed object. The callback method is called when the value is greater than or less than the threshold.</p>
</td>
</tr>
<tr id="row25071033191712"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1350712333172"><a name="p1350712333172"></a><a name="p1350712333172"></a>unobserve</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p115071333121720"><a name="p115071333121720"></a><a name="p115071333121720"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p6507183311710"><a name="p6507183311710"></a><a name="p6507183311710"></a>Unsubscribes from events of the observed object.</p>
</td>
</tr>
</tbody>
</table>
- Example
```
// xxx.js
let observer = this.$element('broad').createIntersectionObserver({
ratios: [0.2, 0.5], // number
});
observer.observe((isVisible, ratio)=> {
console.info('this element is ' + isVisible + 'ratio is ' + ratio)
})
observer.unobserve()
```
**Table 5** Rect<sup>6+</sup>
| Name | Type | Description |
| ------ | ------ | -------------- |
| width | number | Width of the element. |
| height | number | Height of the element. |
| left | number | Offset between the left boundary of the element and the window.|
| top | number | Offset between the upper boundary of the element and the window.|
**Example**
```js
// xxx.js
var rect = this.$element('id').getBoundingClientRect();
console.info(`current element position is ${rect.left}, ${rect.top}`);
```
## createIntersectionObserver
createIntersectionObserver(param?: ObserverParam): Observer
Listens for the visibility of the element on the current page.
**Parameters**
| Name | Type | Mandatory | Description |
| ----- | ------------- | ---- | -------------- |
| param | ObserverParam | - | Observer callback.|
**Table 6** ObserverParam<sup>6+</sup>
| Name | Type | Description |
| ------ | ------------------- | ------------------------ |
| ratios | Array&lt;number&gt; | Range for triggering the observer callback. If the component is not within the range, the observer callback is triggered.|
**Return value**
**Table 7** Methods supported Observer<sup>6+</sup>
| Method | Parameter | Description |
| --------- | ----------------------- | ----------------------------------- |
| observe | callback: function | Subscribes to events of the observed object. The callback method is called when the value is greater than or less than the threshold.|
| unobserve | - | Unsubscribes from events of the observed object. |
**Example**
```js
// xxx.js
let observer = this.$element('broad').createIntersectionObserver({
ratios: [0.2, 0.5], // number
});
observer.observe((isVisible, ratio)=> {
console.info('this element is ' + isVisible + 'ratio is ' + ratio)
})
observer.unobserve()
```
# badge<a name="EN-US_TOPIC_0000001173324629"></a> # badge
The **<badge\>** component is used to mark new events that require user attention in your application. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<badge>** component is used to mark new events that require user attention in your application.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
This component supports only one child component. This component supports only one child component.
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
>If multiple child components are used, only the first one takes effect by default. >
> If multiple child components are used, only the first one takes effect by default.
## Attributes<a name="section1355418214459"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table3871294431"></a>
<table><thead align="left"><tr id="row12871029184318"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="p087529184319"><a name="p087529184319"></a><a name="p087529184319"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.61%" id="mcps1.1.6.1.2"><p id="p2087629204319"><a name="p2087629204319"></a><a name="p2087629204319"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="14.21%" id="mcps1.1.6.1.3"><p id="p1287112911432"><a name="p1287112911432"></a><a name="p1287112911432"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p1687929124312"><a name="p1687929124312"></a><a name="p1687929124312"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="42.54%" id="mcps1.1.6.1.5"><p id="p138732916431"><a name="p138732916431"></a><a name="p138732916431"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row887192994311"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p2087102919434"><a name="p2087102919434"></a><a name="p2087102919434"></a>placement</p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p188822916435"><a name="p188822916435"></a><a name="p188822916435"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p10889298434"><a name="p10889298434"></a><a name="p10889298434"></a>rightTop</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1881929194314"><a name="p1881929194314"></a><a name="p1881929194314"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p1788142954315"><a name="p1788142954315"></a><a name="p1788142954315"></a>Position of a number or dot badge. Available values are as follows:</p>
<a name="ul1388112944320"></a><a name="ul1388112944320"></a><ul id="ul1388112944320"><li><strong id="b3391219132117"><a name="b3391219132117"></a><a name="b3391219132117"></a>right</strong>: on the right border of the component.</li><li><strong id="b341442812510"><a name="b341442812510"></a><a name="b341442812510"></a>rightTop</strong>: in the upper right corner of the component border.</li><li><strong id="b101851310251"><a name="b101851310251"></a><a name="b101851310251"></a>left</strong>: on the left border of the component.</li></ul>
</td>
</tr>
<tr id="row6887294431"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p28822974315"><a name="p28822974315"></a><a name="p28822974315"></a>count</p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p188129194313"><a name="p188129194313"></a><a name="p188129194313"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p288102954310"><a name="p288102954310"></a><a name="p288102954310"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p158852915433"><a name="p158852915433"></a><a name="p158852915433"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p19881229144313"><a name="p19881229144313"></a><a name="p19881229144313"></a>Number of notifications displayed via the badge. The default value is <strong id="b68878221295"><a name="b68878221295"></a><a name="b68878221295"></a>0</strong>. If the number of notifications is greater than 0, the badge changes from a dot to the number. If this attribute is not set or the value is less than or equal to 0, the badge is a dot.</p>
<div class="note" id="note388629144318"><a name="note388629144318"></a><a name="note388629144318"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p488929174319"><a name="p488929174319"></a><a name="p488929174319"></a>When the <strong id="b107952317541"><a name="b107952317541"></a><a name="b107952317541"></a>count</strong> value is greater than the <strong id="b57744085419"><a name="b57744085419"></a><a name="b57744085419"></a>maxcount</strong> value, <em id="i136441735511"><a name="i136441735511"></a><a name="i136441735511"></a>maxcount</em><strong id="b135651010553"><a name="b135651010553"></a><a name="b135651010553"></a>+</strong> is displayed.</p>
<p id="p16106238105113"><a name="p16106238105113"></a><a name="p16106238105113"></a>The largest integer value supported for <strong id="b12402155411712"><a name="b12402155411712"></a><a name="b12402155411712"></a>count</strong> is <strong id="b3868192910710"><a name="b3868192910710"></a><a name="b3868192910710"></a>2147483647</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row1088152994313"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1488329174315"><a name="p1488329174315"></a><a name="p1488329174315"></a>visible</p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p1888102934319"><a name="p1888102934319"></a><a name="p1888102934319"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p88820291436"><a name="p88820291436"></a><a name="p88820291436"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p10881329184320"><a name="p10881329184320"></a><a name="p10881329184320"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p988112917435"><a name="p988112917435"></a><a name="p988112917435"></a>Whether to display the badge. The value <strong id="b15203113585411"><a name="b15203113585411"></a><a name="b15203113585411"></a>true</strong> means that the badge shows up when a new notification is received. To use a number badge, set the <strong id="b102697204598"><a name="b102697204598"></a><a name="b102697204598"></a>count</strong> attribute.</p>
</td>
</tr>
<tr id="row138862934313"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p98872919436"><a name="p98872919436"></a><a name="p98872919436"></a>maxcount</p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p28822920432"><a name="p28822920432"></a><a name="p28822920432"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p28842944318"><a name="p28842944318"></a><a name="p28842944318"></a>99</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p158810298438"><a name="p158810298438"></a><a name="p158810298438"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p3881229164317"><a name="p3881229164317"></a><a name="p3881229164317"></a>Maximum number of notifications. When the number of new notifications exceeds the value of this attribute, <em id="i205207517"><a name="i205207517"></a><a name="i205207517"></a>maxcount</em><strong id="b12397175512"><a name="b12397175512"></a><a name="b12397175512"></a>+</strong> is displayed, for example, <strong id="b19503636557"><a name="b19503636557"></a><a name="b19503636557"></a>99+</strong>.</p>
<div class="note" id="note046285914515"><a name="note046285914515"></a><a name="note046285914515"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p114631559205118"><a name="p114631559205118"></a><a name="p114631559205118"></a>The largest integer value supported for <strong id="b138164151386"><a name="b138164151386"></a><a name="b138164151386"></a>maxcount</strong> is <strong id="b168231615682"><a name="b168231615682"></a><a name="b168231615682"></a>2147483647</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row18881929154314"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p188122934312"><a name="p188122934312"></a><a name="p188122934312"></a>config</p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p128910296432"><a name="p128910296432"></a><a name="p128910296432"></a><a href="../../nottoctopics/en-us_topic_0000001177114381.md#en-us_topic_0000001101866256_table525042221515">BadgeConfig</a></p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p389529124317"><a name="p389529124317"></a><a name="p389529124317"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p589142984319"><a name="p589142984319"></a><a name="p589142984319"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p4890291437"><a name="p4890291437"></a><a name="p4890291437"></a>Configuration of the badge.</p>
</td>
</tr>
<tr id="row08922919437"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p12894299435"><a name="p12894299435"></a><a name="p12894299435"></a>label<sup id="sup14890292436"><a name="sup14890292436"></a><a name="sup14890292436"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="12.61%" headers="mcps1.1.6.1.2 "><p id="p18896292438"><a name="p18896292438"></a><a name="p18896292438"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.21%" headers="mcps1.1.6.1.3 "><p id="p1889429194315"><a name="p1889429194315"></a><a name="p1889429194315"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p6891729124318"><a name="p6891729124318"></a><a name="p6891729124318"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="42.54%" headers="mcps1.1.6.1.5 "><p id="p15894294432"><a name="p15894294432"></a><a name="p15894294432"></a>Text of the new notification displayed via the badge.</p>
<div class="note" id="note168915299438"><a name="note168915299438"></a><a name="note168915299438"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p118982994316"><a name="p118982994316"></a><a name="p118982994316"></a>When this attribute is set, attributes <strong id="b133005251811"><a name="b133005251811"></a><a name="b133005251811"></a>count</strong> and <strong id="b1089219451819"><a name="b1089219451819"></a><a name="b1089219451819"></a>maxcount</strong> do not take effect.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
**Table 1** BadgeConfig
<a name="table525042221515"></a>
<table><thead align="left"><tr id="row10250162216151"><th class="cellrowborder" valign="top" width="15.370000000000001%" id="mcps1.2.6.1.1"><p id="p256733317156"><a name="p256733317156"></a><a name="p256733317156"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="13.62%" id="mcps1.2.6.1.2"><p id="p13567143391514"><a name="p13567143391514"></a><a name="p13567143391514"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="12.46%" id="mcps1.2.6.1.3"><p id="p165679339152"><a name="p165679339152"></a><a name="p165679339152"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.22%" id="mcps1.2.6.1.4"><p id="p1018465012153"><a name="p1018465012153"></a><a name="p1018465012153"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="51.33%" id="mcps1.2.6.1.5"><p id="p1250142241516"><a name="p1250142241516"></a><a name="p1250142241516"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1425022251510"><td class="cellrowborder" valign="top" width="15.370000000000001%" headers="mcps1.2.6.1.1 "><p id="p6944185918156"><a name="p6944185918156"></a><a name="p6944185918156"></a>badgeColor</p>
</td>
<td class="cellrowborder" valign="top" width="13.62%" headers="mcps1.2.6.1.2 "><p id="p3944185918156"><a name="p3944185918156"></a><a name="p3944185918156"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.46%" headers="mcps1.2.6.1.3 "><p id="p494412594152"><a name="p494412594152"></a><a name="p494412594152"></a>#fa2a2d</p>
</td>
<td class="cellrowborder" valign="top" width="7.22%" headers="mcps1.2.6.1.4 "><p id="p2018411507152"><a name="p2018411507152"></a><a name="p2018411507152"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="51.33%" headers="mcps1.2.6.1.5 "><p id="p12623249168"><a name="p12623249168"></a><a name="p12623249168"></a>Background color of the badge</p>
</td>
</tr>
<tr id="row1325114221159"><td class="cellrowborder" valign="top" width="15.370000000000001%" headers="mcps1.2.6.1.1 "><p id="p189441459101515"><a name="p189441459101515"></a><a name="p189441459101515"></a>textColor</p>
</td>
<td class="cellrowborder" valign="top" width="13.62%" headers="mcps1.2.6.1.2 "><p id="p18944175915154"><a name="p18944175915154"></a><a name="p18944175915154"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.46%" headers="mcps1.2.6.1.3 "><p id="p29441859141514"><a name="p29441859141514"></a><a name="p29441859141514"></a>#ffffff</p>
</td>
<td class="cellrowborder" valign="top" width="7.22%" headers="mcps1.2.6.1.4 "><p id="p31843506151"><a name="p31843506151"></a><a name="p31843506151"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="51.33%" headers="mcps1.2.6.1.5 "><p id="p196231461610"><a name="p196231461610"></a><a name="p196231461610"></a>Text color of the number badge</p>
</td>
</tr>
<tr id="row132511522131513"><td class="cellrowborder" valign="top" width="15.370000000000001%" headers="mcps1.2.6.1.1 "><p id="p7945175918154"><a name="p7945175918154"></a><a name="p7945175918154"></a>textSize</p>
</td>
<td class="cellrowborder" valign="top" width="13.62%" headers="mcps1.2.6.1.2 "><p id="p1594515919158"><a name="p1594515919158"></a><a name="p1594515919158"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.46%" headers="mcps1.2.6.1.3 "><p id="p189451259121511"><a name="p189451259121511"></a><a name="p189451259121511"></a>10px</p>
</td>
<td class="cellrowborder" valign="top" width="7.22%" headers="mcps1.2.6.1.4 "><p id="p14184125016151"><a name="p14184125016151"></a><a name="p14184125016151"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="51.33%" headers="mcps1.2.6.1.5 "><p id="p1962474101618"><a name="p1962474101618"></a><a name="p1962474101618"></a>Text size of the number badge</p>
</td>
</tr>
<tr id="row225122212159"><td class="cellrowborder" valign="top" width="15.370000000000001%" headers="mcps1.2.6.1.1 "><p id="p1394585918156"><a name="p1394585918156"></a><a name="p1394585918156"></a>badgeSize</p>
</td>
<td class="cellrowborder" valign="top" width="13.62%" headers="mcps1.2.6.1.2 "><p id="p159451459111519"><a name="p159451459111519"></a><a name="p159451459111519"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="12.46%" headers="mcps1.2.6.1.3 "><p id="p694545961517"><a name="p694545961517"></a><a name="p694545961517"></a>6px</p>
</td>
<td class="cellrowborder" valign="top" width="7.22%" headers="mcps1.2.6.1.4 "><p id="p10184135015153"><a name="p10184135015153"></a><a name="p10184135015153"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="51.33%" headers="mcps1.2.6.1.5 "><p id="p1962410411162"><a name="p1962410411162"></a><a name="p1962410411162"></a>Default size of the dot badge</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The total size of child components must be smaller than or equal to that of the **<badge\>** component. Otherwise, the child components cannot be displayed.
## Events<a name="section43461940193518"></a>
Events in [Universal Events](js-components-common-events.md) are supported.
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section3510104413431"></a>
```
## Attributes
In addition to the [universal attributes](js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------------------ | ----------- | -------- | ---- | ---------------------------------------- |
| placement | string | rightTop | No | Position of a number or dot badge. Available values are as follows:<br>- **right**: on the right border of the component.<br>- **rightTop**: in the upper right corner of the component border.<br>- **left**: on the left border of the component.|
| count | number | 0 | No | Number of notifications displayed via the badge. The default value is **0**. If the number of notifications is greater than 0, the badge changes from a dot to the number. If this attribute is not set or the value is less than or equal to 0, the badge is a dot.<br>When the **count** value is greater than the **maxcount** value, *maxcount***+** is displayed. The largest integer value supported for **count** is **2147483647**.|
| visible | boolean | false | No | Whether to display the badge. The value **true** means that the badge shows up when a new notification is received. To use a number badge, set the **count** attribute.|
| maxcount | number | 99 | No | Maximum number of notifications. When the number of new notifications exceeds the value of this attribute, *maxcount***+** is displayed, for example, **99+**.<br>The largest integer value supported for **maxcount** is **2147483647**.|
| config | BadgeConfig | - | No | Configuration of the badge. |
| label<sup>6+</sup> | string | - | No | Text of the new notification displayed via the badge.<br>When this attribute is set, attributes **count** and **maxcount** do not take effect.|
**Table 1** BadgeConfig
| Name | Type | Default Value | Mandatory | Description |
| ---------- | -------------- | -------- | ---- | ------------ |
| badgeColor | &lt;color&gt; | \#fa2a2d | No | Background color of the badge. |
| textColor | &lt;color&gt; | \#ffffff | No | Text color of the number badge.|
| textSize | &lt;length&gt; | 10px | No | Text size of the number badge.|
| badgeSize | &lt;length&gt; | 6px | No | Default size of the dot badge. |
## Styles
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
> **NOTE**
>
> The total size of child components must be smaller than or equal to that of the **<badge>** component. Otherwise, the child components cannot be displayed.
## Events
The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<badge class="badge" config="{{badgeconfig}}" visible="true" count="100" maxcount="99"> <badge class="badge" config="{{badgeconfig}}" visible="true" count="100" maxcount="99">
...@@ -198,7 +77,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -198,7 +77,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -219,7 +98,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -219,7 +98,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data:{ data:{
...@@ -231,5 +110,4 @@ export default { ...@@ -231,5 +110,4 @@ export default {
} }
``` ```
![](figures/figures1.png) ![figures1](figures/figures1.png)
# dialog<a name="EN-US_TOPIC_0000001173324657"></a> # dialog
The **<dialog\>** component is a custom pop-up container. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<dialog>** component is a custom dialog box.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
A single child component is supported.
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="tb330011ff53049a69f27cec012adf8c1"></a>
<table><thead align="left"><tr id="r4301f3a3b24c499c9bfc42b76ab785f9"><th class="cellrowborder" valign="top" width="19.598040195980403%" id="mcps1.1.6.1.1"><p id="a9ba8c579217b4b8b841b035f1d28b20e"><a name="a9ba8c579217b4b8b841b035f1d28b20e"></a><a name="a9ba8c579217b4b8b841b035f1d28b20e"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="11.178882111788822%" id="mcps1.1.6.1.2"><p id="a633002333b024497914a4b172446f14e"><a name="a633002333b024497914a4b172446f14e"></a><a name="a633002333b024497914a4b172446f14e"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="9.899010098990102%" id="mcps1.1.6.1.3"><p id="a4950f7884c6540b9ad523ac34657d952"><a name="a4950f7884c6540b9ad523ac34657d952"></a><a name="a4950f7884c6540b9ad523ac34657d952"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.56924307569243%" id="mcps1.1.6.1.4"><p id="p58189597166"><a name="p58189597166"></a><a name="p58189597166"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="51.754824517548236%" id="mcps1.1.6.1.5"><p id="a1313564aa9404a338447087d5918c17d"><a name="a1313564aa9404a338447087d5918c17d"></a><a name="a1313564aa9404a338447087d5918c17d"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r06a481428e8d455fba919d3d4618be31"><td class="cellrowborder" valign="top" width="19.598040195980403%" headers="mcps1.1.6.1.1 "><p id="adb8a73146d764f2aab50fc046169ab26"><a name="adb8a73146d764f2aab50fc046169ab26"></a><a name="adb8a73146d764f2aab50fc046169ab26"></a>dragable<sup id="sup999420218191"><a name="sup999420218191"></a><a name="sup999420218191"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="11.178882111788822%" headers="mcps1.1.6.1.2 "><p id="a06898db2627246f78e85d4fbadeee85c"><a name="a06898db2627246f78e85d4fbadeee85c"></a><a name="a06898db2627246f78e85d4fbadeee85c"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="9.899010098990102%" headers="mcps1.1.6.1.3 "><p id="ae685ead324a647bcba1bbb45c9402dd6"><a name="ae685ead324a647bcba1bbb45c9402dd6"></a><a name="ae685ead324a647bcba1bbb45c9402dd6"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.56924307569243%" headers="mcps1.1.6.1.4 "><p id="p78183594166"><a name="p78183594166"></a><a name="p78183594166"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="51.754824517548236%" headers="mcps1.1.6.1.5 "><p id="a692121725a9b4ebbae65cd22b94b672e"><a name="a692121725a9b4ebbae65cd22b94b672e"></a><a name="a692121725a9b4ebbae65cd22b94b672e"></a>Whether the pop-up can be dragged.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- The **<dialog\>** component does not support the **focusable** and **click-effect** attributes.
## Styles<a name="section5775351116"></a>
Only the **width**, **height**, **margin**, **margin-\[left|top|right|bottom\]**, and **margin-\[start|end\]** styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section8562129182916"></a>
Events in [Universal Events](js-components-common-events.md) are not supported. The following table lists the supported event.
<a name="table20562102982910"></a>
<table><thead align="left"><tr id="row9562162932910"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p195626291296"><a name="p195626291296"></a><a name="p195626291296"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p185622029202914"><a name="p185622029202914"></a><a name="p185622029202914"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p9562132915297"><a name="p9562132915297"></a><a name="p9562132915297"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row7562729142911"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p145622291299"><a name="p145622291299"></a><a name="p145622291299"></a>cancel</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p356210295295"><a name="p356210295295"></a><a name="p356210295295"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p55621629122916"><a name="p55621629122916"></a><a name="p55621629122916"></a>Triggered when a user taps a non-dialog area to cancel the pop-up.</p>
</td>
</tr>
<tr id="row154462392615"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p84461834266"><a name="p84461834266"></a><a name="p84461834266"></a>show<sup id="sup2397204717198"><a name="sup2397204717198"></a><a name="sup2397204717198"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p164468315263"><a name="p164468315263"></a><a name="p164468315263"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p204465311269"><a name="p204465311269"></a><a name="p204465311269"></a>Triggered when the pop-up is displayed.</p>
</td>
</tr>
<tr id="row28470175299"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p2848161792917"><a name="p2848161792917"></a><a name="p2848161792917"></a>close<sup id="sup4231174871918"><a name="sup4231174871918"></a><a name="sup4231174871918"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p128481917132913"><a name="p128481917132913"></a><a name="p128481917132913"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p5848121742920"><a name="p5848121742920"></a><a name="p5848121742920"></a>Triggered when the pop-up is closed.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section11753103216253"></a>
Methods in [Universal Methods](js-components-common-methods.md) are not supported. The following table lists the supported methods.
<a name="table20753173210251"></a>
<table><thead align="left"><tr id="row575363214257"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p157531032112517"><a name="p157531032112517"></a><a name="p157531032112517"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p77531632132518"><a name="p77531632132518"></a><a name="p77531632132518"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p147531232132512"><a name="p147531232132512"></a><a name="p147531232132512"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row15753113210251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p2314135812511"><a name="p2314135812511"></a><a name="p2314135812511"></a>show</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p7314115819256"><a name="p7314115819256"></a><a name="p7314115819256"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p0314958162512"><a name="p0314958162512"></a><a name="p0314958162512"></a>Shows a dialog box.</p>
</td>
</tr>
<tr id="row393410526251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p7314358182512"><a name="p7314358182512"></a><a name="p7314358182512"></a>close</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p1231455814253"><a name="p1231455814253"></a><a name="p1231455814253"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p10314105842512"><a name="p10314105842512"></a><a name="p10314105842512"></a>Closes a dialog box.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>Attributes and styles of a **<dialog\>** component cannot be dynamically updated.
## Example Code<a name="section6663311114620"></a>
``` ## Child Components
This component supports only one child component.
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| --------------------- | ------- | ----- | ---- | ------------ |
| dragable<sup>7+</sup> | boolean | false | No | Whether the dialog box can be dragged.|
> **NOTE**
>
> The **\<dialog>** component does not support the **focusable** and **click-effect** attributes.
## Styles
Only the **width**, **height**, **margin**, **margin-[left|top|right|bottom]**, and **margin-[start|end]** styles in [Universal Styles](../arkui-js/js-components-common-styles.md) are supported.
## Events
The following events are supported. The [universal events](../arkui-js/js-components-common-events.md) are not supported.
| Name | Parameter | Description |
| ------------------ | ---- | -------------------------- |
| cancel | - | Triggered when a user touches an area outside the dialog box to cancel the dialog box.|
| show<sup>7+</sup> | - | Triggered when the dialog box is displayed. |
| close<sup>7+</sup> | - | Triggered when the dialog box is closed. |
## Methods
The following methods are supported. The [universal methods](../arkui-js/js-components-common-methods.md) are not supported.
| Name | Parameter | Description |
| ----- | ---- | ------ |
| show | - | Shows a dialog box.|
| close | - | Close the dialog box.|
> **NOTE**
>
> Attributes and styles of a **\<dialog>** component cannot be dynamically updated.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="doc-page"> <div class="doc-page">
<div class="btn-div"> <div class="btn-div">
...@@ -140,7 +81,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor ...@@ -140,7 +81,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.doc-page { .doc-page {
flex-direction: column; flex-direction: column;
...@@ -189,31 +130,31 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor ...@@ -189,31 +130,31 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
showDialog(e) { showDialog() {
this.$element('simpledialog').show() this.$element('simpledialog').show()
}, },
cancelDialog(e) { cancelDialog() {
prompt.showToast({ prompt.showToast({
message: 'Dialog cancelled' message: 'Dialog cancelled'
}) })
}, },
cancelSchedule(e) { cancelSchedule() {
this.$element('simpledialog').close() this.$element('simpledialog').close()
prompt.showToast({ prompt.showToast({
message: 'Successfully cancelled' message: 'Successfully cancelled'
}) })
}, },
setSchedule(e) { setSchedule() {
this.$element('simpledialog').close() this.$element('simpledialog').close()
prompt.showToast({ prompt.showToast({
message: 'Successfully confirmed' message: 'Successfully confirmed'
}) })
}, },
doubleclick(e){ doubleclick(){
prompt.showToast({ prompt.showToast({
message: 'doubleclick' message: 'doubleclick'
}) })
...@@ -221,5 +162,4 @@ export default { ...@@ -221,5 +162,4 @@ export default {
} }
``` ```
![](figures/4.gif) ![4](figures/4.gif)
# div # div
The **\<div>** component is a basic container that is used as the root node of the page structure or is used to group the content.
> **NOTE** > **NOTE**
> >
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
The **\<div>** component is a basic container that is used as the root node of the page structure or is used to group the content.
## Required Permissions ## Required Permissions
......
# form<a name="EN-US_TOPIC_0000001127284848"></a> # form
The **<form\>** component allows the content in **input** elements to be submitted and reset. > **NOTE**
>
> This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<form>** component allows the content in **input** elements to be submitted and reset.
## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
## Child Components
Supported Supported
## Attributes<a name="section2907183951110"></a>
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section10683162023215"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section77341431152917"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table1180610218398"></a>
<table><thead align="left"><tr id="row8806162153917"><th class="cellrowborder" valign="top" width="22.7022702270227%" id="mcps1.1.4.1.1"><p id="p0807112143914"><a name="p0807112143914"></a><a name="p0807112143914"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="16.881688168816883%" id="mcps1.1.4.1.2"><p id="p380752110397"><a name="p380752110397"></a><a name="p380752110397"></a>Parameters</p>
</th>
<th class="cellrowborder" valign="top" width="60.41604160416041%" id="mcps1.1.4.1.3"><p id="p118071121183910"><a name="p118071121183910"></a><a name="p118071121183910"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row380713217397"><td class="cellrowborder" valign="top" width="22.7022702270227%" headers="mcps1.1.4.1.1 "><p id="p19132135593918"><a name="p19132135593918"></a><a name="p19132135593918"></a>submit</p>
</td>
<td class="cellrowborder" valign="top" width="16.881688168816883%" headers="mcps1.1.4.1.2 "><p id="p17807152183918"><a name="p17807152183918"></a><a name="p17807152183918"></a><a href="#table195257111418">FormResult</a></p>
</td>
<td class="cellrowborder" valign="top" width="60.41604160416041%" headers="mcps1.1.4.1.3 "><p id="p8807102116392"><a name="p8807102116392"></a><a name="p8807102116392"></a>Triggered when the Submit button is touched.</p>
</td>
</tr>
<tr id="row38502504218"><td class="cellrowborder" valign="top" width="22.7022702270227%" headers="mcps1.1.4.1.1 "><p id="p1085019519428"><a name="p1085019519428"></a><a name="p1085019519428"></a>reset</p>
</td>
<td class="cellrowborder" valign="top" width="16.881688168816883%" headers="mcps1.1.4.1.2 "><p id="p108501958427"><a name="p108501958427"></a><a name="p108501958427"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="60.41604160416041%" headers="mcps1.1.4.1.3 "><p id="p2850758423"><a name="p2850758423"></a><a name="p2850758423"></a>Triggered when the Reset button is clicked.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** FormResult
<a name="table195257111418"></a>
<table><thead align="left"><tr id="row55251211114111"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p2052551119411"><a name="p2052551119411"></a><a name="p2052551119411"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p2525141116412"><a name="p2525141116412"></a><a name="p2525141116412"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p55251011134114"><a name="p55251011134114"></a><a name="p55251011134114"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row352501115412"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p15525191113412"><a name="p15525191113412"></a><a name="p15525191113412"></a>value</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p145256112413"><a name="p145256112413"></a><a name="p145256112413"></a>Object</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1852512118411"><a name="p1852512118411"></a><a name="p1852512118411"></a>Values of <strong id="b194181133618"><a name="b194181133618"></a><a name="b194181133618"></a>name</strong> and <strong id="b1690145461"><a name="b1690145461"></a><a name="b1690145461"></a>value</strong> of the input element.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section1241545010391"></a>
``` ## Attributes
The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
## Styles
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| submit | FormResult | Triggered when the **Submit** button is touched.|
| reset | - | Triggered when the **Reset** button is clicked.|
**Table 1** FormResult
| Name| Type| Description|
| -------- | -------- | -------- |
| value | Object | Values of **name** and **value** of the input element.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<form onsubmit='onSubmit' onreset='onReset'> <form onsubmit='onSubmit' onreset='onReset'>
<div style="width: 600px;height: 150px;flex-direction: row;justify-content: space-around;"> <div style="width: 600px;height: 150px;flex-direction: row;justify-content: space-around;">
...@@ -93,7 +68,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -93,7 +68,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</form> </form>
``` ```
``` ```js
// xxx.js // xxx.js
export default{ export default{
onSubmit(result) { onSubmit(result) {
...@@ -106,5 +81,4 @@ export default{ ...@@ -106,5 +81,4 @@ export default{
} }
``` ```
![](figures/001.gif) ![001](figures/001.gif)
...@@ -18,7 +18,7 @@ None ...@@ -18,7 +18,7 @@ None
## Child Components ## Child Components
Only the [\<list-item>](../arkui-js/js-components-container-list-item.md) child component is supported. Only the **[\<list-item>](../arkui-js/js-components-container-list-item.md)** component is supported.
## Attributes ## Attributes
......
# list-item<a name="EN-US_TOPIC_0000001127125046"></a> # list-item
**<list-item\>** is a child component of the **<[list](js-components-container-list.md)\>** component and is used to display items in a list. You can customize the width of each **<list-item\>**. However, if you retain the default value **stretch** of **align-items** for the parent component **<list\>**, the width of **<list-item\>** is equal to that of **<list\>**. You can set **align-items** to other values rather than **stretch** to make the customized **<list-item-group\>** width take effect. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> **\<list-item>** is a child component of the **[\<list>](../arkui-js/js-components-container-list.md)** component and is used to display items in a list. You can customize the width of each **\<list-item>**. However, if you retain the default value **stretch** of **align-items** for the parent component **\<list>**, the width of **\<list-item>** is equal to that of **\<list>**. To make the customized **\<list-item>** width take effect, set **align-items** to other values rather than **stretch**.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
This component supports only one child component. This component supports only one child component.
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table1868413436126"></a>
<table><thead align="left"><tr id="row7684164319127"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"><a name="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"></a><a name="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"><a name="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"></a><a name="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"><a name="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"></a><a name="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p3684134381211"><a name="p3684134381211"></a><a name="p3684134381211"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"><a name="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"></a><a name="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row14827156171315"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p2095581381314"><a name="p2095581381314"></a><a name="p2095581381314"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1956151315137"><a name="p1956151315137"></a><a name="p1956151315137"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p8956111351319"><a name="p8956111351319"></a><a name="p8956111351319"></a>default</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p14956141314133"><a name="p14956141314133"></a><a name="p14956141314133"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1595671312135"><a name="p1595671312135"></a><a name="p1595671312135"></a>Type of the list-item. A list can contain multiple list-item types. The same type of list items should have the same view layout after being rendered. When the type is fixed, replace the <strong id="b1152364710610"><a name="b1152364710610"></a><a name="b1152364710610"></a>if</strong> attribute with the <strong id="b8963450964"><a name="b8963450964"></a><a name="b8963450964"></a>show</strong> attribute to ensure that the view layout remains unchanged.</p>
</td>
</tr>
<tr id="row182818671318"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p209561313171315"><a name="p209561313171315"></a><a name="p209561313171315"></a>primary</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p195631313131"><a name="p195631313131"></a><a name="p195631313131"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p7956181316134"><a name="p7956181316134"></a><a name="p7956181316134"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1895681321315"><a name="p1895681321315"></a><a name="p1895681321315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p995671314134"><a name="p995671314134"></a><a name="p995671314134"></a>The value <strong id="b133217164716"><a name="b133217164716"></a><a name="b133217164716"></a>true</strong> indicates that the item is the primary item in the group, which is the item that appears in a collapsed group. If there is more than one item marked as primary, the first one is the primary item. If there is no item marked as primary, the first item is the primary item.</p>
</td>
</tr>
<tr id="row16295321132"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p16956101311310"><a name="p16956101311310"></a><a name="p16956101311310"></a>section</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p195611135133"><a name="p195611135133"></a><a name="p195611135133"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p209561413191315"><a name="p209561413191315"></a><a name="p209561413191315"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p20956111318130"><a name="p20956111318130"></a><a name="p20956111318130"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p2956161391313"><a name="p2956161391313"></a><a name="p2956161391313"></a>String used to match this item. This attribute can be left empty. The value cannot be dynamically updated. In a list item group, only the string set for the primary item is valid.</p>
</td>
</tr>
<tr id="row1629515214134"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p2095641311138"><a name="p2095641311138"></a><a name="p2095641311138"></a>sticky</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6957141317138"><a name="p6957141317138"></a><a name="p6957141317138"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p295771313131"><a name="p295771313131"></a><a name="p295771313131"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p199571613151311"><a name="p199571613151311"></a><a name="p199571613151311"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p29571313131310"><a name="p29571313131310"></a><a name="p29571313131310"></a>Whether the current item sticks in place at the top, and the effect when it disappears. This attribute supports vertical lists only and is invalid for items in a group.</p>
<a name="ul69572137130"></a><a name="ul69572137130"></a><ul id="ul69572137130"><li><strong id="b13151921114"><a name="b13151921114"></a><a name="b13151921114"></a>none</strong>: The current item does not stick at the top.</li><li><strong id="b646332811"><a name="b646332811"></a><a name="b646332811"></a>normal</strong>: The current item sticks at the top and disappears with a sliding effect.</li><li><strong id="b20166151733418"><a name="b20166151733418"></a><a name="b20166151733418"></a>opacity</strong>: The current item sticks at the top and disappears gradually. This option is only supported on wearables.</li></ul>
</td>
</tr>
<tr id="row6359185421211"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p109577139132"><a name="p109577139132"></a><a name="p109577139132"></a>clickeffect<sup id="sup1375415364114"><a name="sup1375415364114"></a><a name="sup1375415364114"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p9957161341310"><a name="p9957161341310"></a><a name="p9957161341310"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p99571013181316"><a name="p99571013181316"></a><a name="p99571013181316"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p139571513121313"><a name="p139571513121313"></a><a name="p139571513121313"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p99581613141313"><a name="p99581613141313"></a><a name="p99581613141313"></a>Whether an effect is displayed when the current item is clicked.</p>
<a name="ul1958513101318"></a><a name="ul1958513101318"></a><ul id="ul1958513101318"><li><strong id="b206206251067"><a name="b206206251067"></a><a name="b206206251067"></a>false</strong>: No effect is displayed when the item is clicked.</li><li><strong id="b1974082612456"><a name="b1974082612456"></a><a name="b1974082612456"></a>true</strong>: An effect is displayed when the item is clicked.</li></ul>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table164819331216"></a>
<table><thead align="left"><tr id="row1548217331922"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p19482733426"><a name="p19482733426"></a><a name="p19482733426"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="p174821332212"><a name="p174821332212"></a><a name="p174821332212"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p1948203319214"><a name="p1948203319214"></a><a name="p1948203319214"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p1482733627"><a name="p1482733627"></a><a name="p1482733627"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p1348213331227"><a name="p1348213331227"></a><a name="p1348213331227"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row124821733120"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p34821331428"><a name="p34821331428"></a><a name="p34821331428"></a>column-span</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p24823331213"><a name="p24823331213"></a><a name="p24823331213"></a>&lt;number&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1848211334211"><a name="p1848211334211"></a><a name="p1848211334211"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p14482133318219"><a name="p14482133318219"></a><a name="p14482133318219"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p24821933921"><a name="p24821933921"></a><a name="p24821933921"></a>Number of columns occupied by the current list-item in the list. By default, the list-item occupies one column. This attribute is valid only when the list contains multiple columns.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1948820711216"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table7489127521"></a>
<table><thead align="left"><tr id="row848957922"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p748914712220"><a name="p748914712220"></a><a name="p748914712220"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="22.82228222822282%" id="mcps1.1.4.1.2"><p id="p194899713219"><a name="p194899713219"></a><a name="p194899713219"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="52.32523252325233%" id="mcps1.1.4.1.3"><p id="p14489471229"><a name="p14489471229"></a><a name="p14489471229"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row14891075219"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p124898715214"><a name="p124898715214"></a><a name="p124898715214"></a>sticky </p>
</td>
<td class="cellrowborder" valign="top" width="22.82228222822282%" headers="mcps1.1.4.1.2 "><p id="p048977429"><a name="p048977429"></a><a name="p048977429"></a>{ state: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="52.32523252325233%" headers="mcps1.1.4.1.3 "><p id="p3489773215"><a name="p3489773215"></a><a name="p3489773215"></a>Callback events for a sticky component.</p>
<p id="p44891171220"><a name="p44891171220"></a><a name="p44891171220"></a><strong id="b3628542811"><a name="b3628542811"></a><a name="b3628542811"></a>value: false</strong>: The current item is not in the sticky state.</p>
<p id="p74892071427"><a name="p74892071427"></a><a name="p74892071427"></a><strong id="b6657181394"><a name="b6657181394"></a><a name="b6657181394"></a>value: true</strong>: The current item is in the sticky state.</p>
<p id="p74895716210"><a name="p74895716210"></a><a name="p74895716210"></a>This event is supported only when the item is configured with the <strong id="b15560112218363"><a name="b15560112218363"></a><a name="b15560112218363"></a>sticky</strong> attribute.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section634316188515"></a>
For details, see the [list example code](js-components-container-list.md#example).
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| type | string | default | No| Type of the list-item. A list can contain multiple list-item types. The same type of list items should have the same view layout after being rendered. When the type is fixed, replace the **if** attribute with the **show** attribute to ensure that the view layout remains unchanged.|
| primary | boolean | false | No| Whether the item is the primary item in the group. The value **true** indicates that the item is the primary item in the group, which is the item that appears in a collapsed group. If there is more than one item marked as primary, the first one is the primary item. If there is no item marked as primary, the first item is the primary item.|
| section | string | - | No| String used to match the item. This attribute can be left empty. The value cannot be dynamically updated. In a list item group, only the string set for the primary item is valid.|
| sticky | string | none | No| Whether the current item sticks in place at the top, and the effect when it disappears. This attribute supports vertical lists only and is invalid for items in a group.<br>- **none**: The current item does not stick at the top.<br>- **normal**: The current item sticks at the top and disappears with a sliding effect.<br>- **opacity**: The current item sticks at the top and disappears gradually. This option is only supported on wearables.|
| clickeffect<sup>5+</sup> | boolean | true | No| Whether an effect is displayed when the current item is clicked.<br>- **false**: No effect is displayed when the item is clicked.<br>- **true**: An effect is displayed when the item is clicked.|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| column-span | &lt;number&gt; | 1 | No| Number of columns occupied by the current list-item in the list. By default, the list-item occupies one column. This attribute is valid only when the list contains multiple columns.|
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| sticky | { state: boolean } | Callback event for a sticky component.<br>**value: false**: The current item is not in the sticky state.<br>**value: true**: The current item is in the sticky state.<br>This event is supported only when the item is configured with the **sticky** attribute.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
For details, see [Example in list](../arkui-js/js-components-container-list.md#example).
# list<a name="EN-US_TOPIC_0000001127284836"></a> # list
The **<list\>** component provides a list container that presents a series of list items arranged in a column with the same width. Lists support presentations of the same data in a multiple and coherent row style, for example, images and texts. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<list>** component provides a list container that presents a series of list items arranged in a column with the same width. It supports presentations of the same type of data in a multiple and coherent row style, for example, images or text.
N/A ## Required Permissions
## Child Components<a name="section9288143101012"></a> None
<[list-item](js-components-container-list-item-group.md)\> and <[list-item-group](js-components-container-list-item.md)\>
## Attributes<a name="section2907183951110"></a> ## Child Components
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. The **[\<list-item-group>](../arkui-js/js-components-container-list-item-group.md)** and **[\<list-item>](../arkui-js/js-components-container-list-item.md)** components are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"><a name="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"></a><a name="en-us_topic_0000001058340523_a9ba8c579217b4b8b841b035f1d28b20e"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"><a name="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"></a><a name="en-us_topic_0000001058340523_a633002333b024497914a4b172446f14e"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"><a name="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"></a><a name="en-us_topic_0000001058340523_a4950f7884c6540b9ad523ac34657d952"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"><a name="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"></a><a name="en-us_topic_0000001058340523_a1313564aa9404a338447087d5918c17d"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row389219166580"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p32747328584"><a name="p32747328584"></a><a name="p32747328584"></a>scrollpage</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1927413328589"><a name="p1927413328589"></a><a name="p1927413328589"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p142747324586"><a name="p142747324586"></a><a name="p142747324586"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1827423217589"><a name="p1827423217589"></a><a name="p1827423217589"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p627473213585"><a name="p627473213585"></a><a name="p627473213585"></a>Whether to scroll the non-list part on the top of the list page out of the visible area with the list. The value can be <strong id="b1827263010156"><a name="b1827263010156"></a><a name="b1827263010156"></a>true</strong> (scrolls the non-list part out) or <strong id="b1020123281511"><a name="b1020123281511"></a><a name="b1020123281511"></a>false</strong> (does not scroll the non-list part out). This attribute is not available when the direction is <strong id="b661941418162"><a name="b661941418162"></a><a name="b661941418162"></a>row</strong>.</p>
</td>
</tr>
<tr id="row9893216145818"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p112749323589"><a name="p112749323589"></a><a name="p112749323589"></a>cachedcount</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1427483225810"><a name="p1427483225810"></a><a name="p1427483225810"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p16274432145815"><a name="p16274432145815"></a><a name="p16274432145815"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p32741132185811"><a name="p32741132185811"></a><a name="p32741132185811"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p02741932195811"><a name="p02741932195811"></a><a name="p02741932195811"></a>Minimum number of cached list items when the long list is loaded with delay.</p>
<p id="p182741432115814"><a name="p182741432115814"></a><a name="p182741432115814"></a>When the number of list items cached outside the visible area is less than the value of this attribute, a <strong id="b34911451101"><a name="b34911451101"></a><a name="b34911451101"></a>requestitem</strong> event is triggered.</p>
</td>
</tr>
<tr id="row9893131620589"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p827410325586"><a name="p827410325586"></a><a name="p827410325586"></a>scrollbar</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p72741332125816"><a name="p72741332125816"></a><a name="p72741332125816"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p122741532125818"><a name="p122741532125818"></a><a name="p122741532125818"></a>off</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1227413295813"><a name="p1227413295813"></a><a name="p1227413295813"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p142744322587"><a name="p142744322587"></a><a name="p142744322587"></a>Display mode of the side scrollbar. (Currently, only the vertical scrollbar is supported.)</p>
<a name="ul162752325582"></a><a name="ul162752325582"></a><ul id="ul162752325582"><li><strong id="b067574210418"><a name="b067574210418"></a><a name="b067574210418"></a>off</strong>: No display</li><li><strong id="b694151664211"><a name="b694151664211"></a><a name="b694151664211"></a>auto</strong>: Displayed on demand (The side scrollbar is displayed when touched and disappears 2s later.)</li><li><strong id="b19479834154210"><a name="b19479834154210"></a><a name="b19479834154210"></a>on</strong>: Always displayed</li></ul>
</td>
</tr>
<tr id="row1089321620582"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1275832125813"><a name="p1275832125813"></a><a name="p1275832125813"></a>scrolleffect</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p7275193216582"><a name="p7275193216582"></a><a name="p7275193216582"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p13275232125815"><a name="p13275232125815"></a><a name="p13275232125815"></a>spring</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p327520323585"><a name="p327520323585"></a><a name="p327520323585"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1827516324585"><a name="p1827516324585"></a><a name="p1827516324585"></a>Scroll effect. Available values are as follows:</p>
<a name="ul13275532195819"></a><a name="ul13275532195819"></a><ul id="ul13275532195819"><li><strong id="b687114363370"><a name="b687114363370"></a><a name="b687114363370"></a>spring</strong>: Similar to the physical dynamic effect of a spring. After scrolling to the edge, you can continue to scroll for a distance based on the initial speed or by touching the knob of the scrollbar. After you release your hand, the knob is rebounded.</li><li><strong id="b767535112394"><a name="b767535112394"></a><a name="b767535112394"></a>fade</strong>: Similar to the physical dynamic effect of fade. When you scroll to the edge, a wave shape fades. The fade changes according to the speed and scrolling distance.</li><li><strong id="b136381350114118"><a name="b136381350114118"></a><a name="b136381350114118"></a>no</strong>: No effect after the scrollbar is moved to the edge.</li></ul>
</td>
</tr>
<tr id="row208941516165811"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1327573215812"><a name="p1327573215812"></a><a name="p1327573215812"></a>indexer</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p15275163245815"><a name="p15275163245815"></a><a name="p15275163245815"></a>boolean | Array&lt;string&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p427553220580"><a name="p427553220580"></a><a name="p427553220580"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p627613214585"><a name="p627613214585"></a><a name="p627613214585"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1127613275818"><a name="p1127613275818"></a><a name="p1127613275818"></a>Whether to display the alphabetical index bar on the sidebar. If this attribute is set to <strong id="b1035315299257"><a name="b1035315299257"></a><a name="b1035315299257"></a>true</strong> or a customized indexer, the index bar is displayed at the right boundary of the list. Example:</p>
<p id="p19276132105811"><a name="p19276132105811"></a><a name="p19276132105811"></a><strong id="b119841862711"><a name="b119841862711"></a><a name="b119841862711"></a>"indexer" : "true"</strong> indicates the default alphabetical indexer.</p>
<p id="p10276133295813"><a name="p10276133295813"></a><a name="p10276133295813"></a><strong id="b158642216272"><a name="b158642216272"></a><a name="b158642216272"></a>"indexer" : "false"</strong> indicates no indexer.</p>
<p id="p1027643295815"><a name="p1027643295815"></a><a name="p1027643295815"></a>"indexer": ['#', '1', '2', '3', '4', '5', '6', '7', '8'] indicates a customized index. You must include <strong id="b095305716565"><a name="b095305716565"></a><a name="b095305716565"></a>"#"</strong> when using a customized indexer.</p>
<div class="note" id="note1752771418501"><a name="note1752771418501"></a><a name="note1752771418501"></a><span class="notetitle"> NOTE: </span><div class="notebody"><a name="ul55231518155017"></a><a name="ul55231518155017"></a><ul id="ul55231518155017"><li>This attribute is valid only when <strong id="b15581134072810"><a name="b15581134072810"></a><a name="b15581134072810"></a>flex-direction</strong> is set to <strong id="b13563344132812"><a name="b13563344132812"></a><a name="b13563344132812"></a>column</strong> and <strong id="b1047494711284"><a name="b1047494711284"></a><a name="b1047494711284"></a>columns</strong> is set to <strong id="b2312249162819"><a name="b2312249162819"></a><a name="b2312249162819"></a>1</strong>.</li><li>This attribute must be used together with the <a href="js-components-container-list-item.md#section2907183951110">section</a> attribute of <strong id="b562515564293"><a name="b562515564293"></a><a name="b562515564293"></a>&lt;list-item&gt;</strong>.</li></ul>
</div></div>
</td>
</tr>
<tr id="row1981645163320"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p105121047125317"><a name="p105121047125317"></a><a name="p105121047125317"></a>indexercircle<sup id="sup43038121535"><a name="sup43038121535"></a><a name="sup43038121535"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p8512114712538"><a name="p8512114712538"></a><a name="p8512114712538"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p551317471531"><a name="p551317471531"></a><a name="p551317471531"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p4513547195316"><a name="p4513547195316"></a><a name="p4513547195316"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1898916471451"><a name="p1898916471451"></a><a name="p1898916471451"></a>Whether to use a circle indexer.</p>
<p id="p10513447125316"><a name="p10513447125316"></a><a name="p10513447125316"></a>The default value is <strong id="b337272111448"><a name="b337272111448"></a><a name="b337272111448"></a>true</strong> for wearables and <strong id="b83154814105"><a name="b83154814105"></a><a name="b83154814105"></a>false</strong> for other device types. This attribute is invalid if <strong id="b155631448185810"><a name="b155631448185810"></a><a name="b155631448185810"></a>indexer</strong> is set to <strong id="b115688487588"><a name="b115688487588"></a><a name="b115688487588"></a>false</strong>.</p>
</td>
</tr>
<tr id="row1926180153418"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1370619211500"><a name="p1370619211500"></a><a name="p1370619211500"></a>indexermulti<sup id="sup1478641710316"><a name="sup1478641710316"></a><a name="sup1478641710316"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p13706112125019"><a name="p13706112125019"></a><a name="p13706112125019"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1770622195017"><a name="p1770622195017"></a><a name="p1770622195017"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p97060218503"><a name="p97060218503"></a><a name="p97060218503"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1768357350"><a name="p1768357350"></a><a name="p1768357350"></a>Whether to use a multi-language indexer.</p>
<p id="p57061219500"><a name="p57061219500"></a><a name="p57061219500"></a>This attribute is invalid if <strong id="b18235164351416"><a name="b18235164351416"></a><a name="b18235164351416"></a>indexer</strong> is set to <strong id="b223554316147"><a name="b223554316147"></a><a name="b223554316147"></a>false</strong>.</p>
</td>
</tr>
<tr id="row289205623319"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p336515269516"><a name="p336515269516"></a><a name="p336515269516"></a>indexerbubble<sup id="sup3412121919314"><a name="sup3412121919314"></a><a name="sup3412121919314"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p836613263515"><a name="p836613263515"></a><a name="p836613263515"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p153661126165120"><a name="p153661126165120"></a><a name="p153661126165120"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p0366182611512"><a name="p0366182611512"></a><a name="p0366182611512"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p15708185468"><a name="p15708185468"></a><a name="p15708185468"></a>Whether to display the bubble effect when switching among indexes.</p>
<p id="p12366132614518"><a name="p12366132614518"></a><a name="p12366132614518"></a>This attribute is invalid if <strong id="b3399153701610"><a name="b3399153701610"></a><a name="b3399153701610"></a>indexer</strong> is set to <strong id="b14404237151617"><a name="b14404237151617"></a><a name="b14404237151617"></a>false</strong>.</p>
</td>
</tr>
<tr id="row19197115453311"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p191412818511"><a name="p191412818511"></a><a name="p191412818511"></a>divider<sup id="sup918814291347"><a name="sup918814291347"></a><a name="sup918814291347"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3914284516"><a name="p3914284516"></a><a name="p3914284516"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p10914285514"><a name="p10914285514"></a><a name="p10914285514"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p8914148051"><a name="p8914148051"></a><a name="p8914148051"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p111882182061"><a name="p111882182061"></a><a name="p111882182061"></a>Whether list items are separated by dividers.</p>
<p id="p20914284518"><a name="p20914284518"></a><a name="p20914284518"></a>For details about divider styles, see <strong id="b1680911361100"><a name="b1680911361100"></a><a name="b1680911361100"></a>divider-color</strong>, <strong id="b270113916020"><a name="b270113916020"></a><a name="b270113916020"></a>divider-height</strong>, <strong id="b312394211012"><a name="b312394211012"></a><a name="b312394211012"></a>divider-length</strong>, and <strong id="b17431644908"><a name="b17431644908"></a><a name="b17431644908"></a>divider-origin</strong> in the <a href="../../nottoctopics/en-us_topic_0000001131154746.md#section1071433432218">Styles</a> table.</p>
</td>
</tr>
<tr id="row311191013583"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p9276123217583"><a name="p9276123217583"></a><a name="p9276123217583"></a>shapemode</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1527610320588"><a name="p1527610320588"></a><a name="p1527610320588"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p17276832195815"><a name="p17276832195815"></a><a name="p17276832195815"></a>default</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p142761532145817"><a name="p142761532145817"></a><a name="p142761532145817"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p182761532205818"><a name="p182761532205818"></a><a name="p182761532205818"></a>Shape of the side scrollbar.</p>
<a name="ul4276203212589"></a><a name="ul4276203212589"></a><ul id="ul4276203212589"><li><strong id="b1694164924312"><a name="b1694164924312"></a><a name="b1694164924312"></a>default</strong>: not specified (following the theme)</li><li><strong id="b4888059134313"><a name="b4888059134313"></a><a name="b4888059134313"></a>rect</strong>: rectangle</li><li><strong id="b631715664410"><a name="b631715664410"></a><a name="b631715664410"></a>round</strong>: circle</li></ul>
</td>
</tr>
<tr id="row1465212481574"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p102776324585"><a name="p102776324585"></a><a name="p102776324585"></a>updateeffect</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p4277133275818"><a name="p4277133275818"></a><a name="p4277133275818"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p627763235813"><a name="p627763235813"></a><a name="p627763235813"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1927893215584"><a name="p1927893215584"></a><a name="p1927893215584"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p3278032145815"><a name="p3278032145815"></a><a name="p3278032145815"></a>Whether a dynamic effect is displayed when an item in the list is deleted or added.</p>
<a name="ul8278153205815"></a><a name="ul8278153205815"></a><ul id="ul8278153205815"><li><strong id="b1406192914574"><a name="b1406192914574"></a><a name="b1406192914574"></a>false</strong>: No dynamic effect is displayed.</li><li><strong id="b139515324582"><a name="b139515324582"></a><a name="b139515324582"></a>true</strong>: A dynamic effect is displayed when an item is added or deleted.</li></ul>
</td>
</tr>
<tr id="row1788316557427"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p198831055124217"><a name="p198831055124217"></a><a name="p198831055124217"></a>chainanimation<sup id="sup13376443103416"><a name="sup13376443103416"></a><a name="sup13376443103416"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p0883955174217"><a name="p0883955174217"></a><a name="p0883955174217"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p888305574219"><a name="p888305574219"></a><a name="p888305574219"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p19884755204213"><a name="p19884755204213"></a><a name="p19884755204213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p78841255154210"><a name="p78841255154210"></a><a name="p78841255154210"></a>Whether to display chained animations on this list when it slides or its top and bottom are dragged. The list items are separated with even space, and one item animation starts after the previous animation during basic sliding interactions. The chained animation effect is similar with spring physics.</p>
<a name="ul1490293714519"></a><a name="ul1490293714519"></a><ul id="ul1490293714519"><li><strong id="b19321195416183"><a name="b19321195416183"></a><a name="b19321195416183"></a>false</strong>: Chained animations are displayed.</li><li><strong id="b1493073215190"><a name="b1493073215190"></a><a name="b1493073215190"></a>true</strong>: No chained animation is displayed.<div class="note" id="note775214910343"><a name="note775214910343"></a><a name="note775214910343"></a><span class="notetitle"> NOTE: </span><div class="notebody"><a name="ul99031432111819"></a><a name="ul99031432111819"></a><ul id="ul99031432111819"><li>Dynamic modification is not supported.</li><li>This attribute does not take effect if an indexer is used.</li><li>If this attribute is <strong id="b93341294243"><a name="b93341294243"></a><a name="b93341294243"></a>true</strong>, the <strong id="b123631857114410"><a name="b123631857114410"></a><a name="b123631857114410"></a>sticky</strong> attributes set for <strong id="b17762181514469"><a name="b17762181514469"></a><a name="b17762181514469"></a>&lt;list-item&gt;</strong> components do not take effect.</li></ul>
</div></div>
</li></ul>
</td>
</tr>
<tr id="row114931435579"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p2278932185814"><a name="p2278932185814"></a><a name="p2278932185814"></a>initialindex</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p627818324584"><a name="p627818324584"></a><a name="p627818324584"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p142783321586"><a name="p142783321586"></a><a name="p142783321586"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p20278123225811"><a name="p20278123225811"></a><a name="p20278123225811"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p19236720152515"><a name="p19236720152515"></a><a name="p19236720152515"></a>Item to be displayed at the start position of the viewport when the current list is loaded for the first time. The default value is <strong id="b1823682018251"><a name="b1823682018251"></a><a name="b1823682018251"></a>0</strong>, indicating that the first item is displayed.</p>
<p id="p16604922152515"><a name="p16604922152515"></a><a name="p16604922152515"></a>The setting does not take effect in any of the following cases:</p>
<a name="ul920222662516"></a><a name="ul920222662516"></a><ul id="ul920222662516"><li>The value you set is greater than the index of the last item.</li><li>The <strong id="b39045241265"><a name="b39045241265"></a><a name="b39045241265"></a>initialoffset</strong> attribute is set.</li><li><strong id="b102021626202510"><a name="b102021626202510"></a><a name="b102021626202510"></a>indexer</strong> or <strong id="b1420282652515"><a name="b1420282652515"></a><a name="b1420282652515"></a>scrollpage</strong> is set to <strong id="b192021826132518"><a name="b192021826132518"></a><a name="b192021826132518"></a>true</strong>.</li></ul>
</td>
</tr>
<tr id="row950539135714"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p827963212580"><a name="p827963212580"></a><a name="p827963212580"></a>initialoffset</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p227917321582"><a name="p227917321582"></a><a name="p227917321582"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p62791332105814"><a name="p62791332105814"></a><a name="p62791332105814"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1527943212583"><a name="p1527943212583"></a><a name="p1527943212583"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p327920329582"><a name="p327920329582"></a><a name="p327920329582"></a>Start offset of the viewport when the current list is loaded for the first time. The offset must not exceed the scrolling range of the current list. If exceeded, the offset is truncated to the maximum value of the scrolling range. This attribute does not take effect if <strong id="b519019121326"><a name="b519019121326"></a><a name="b519019121326"></a>indexer</strong> or <strong id="b519531213210"><a name="b519531213210"></a><a name="b519531213210"></a>scrollpage</strong> is set to <strong id="b121953129219"><a name="b121953129219"></a><a name="b121953129219"></a>true</strong>.</p>
</td>
</tr>
<tr id="row1914605315918"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19147135375914"><a name="p19147135375914"></a><a name="p19147135375914"></a>selected<sup id="sup2083525912347"><a name="sup2083525912347"></a><a name="sup2083525912347"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p12147105375915"><a name="p12147105375915"></a><a name="p12147105375915"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p161471753195920"><a name="p161471753195920"></a><a name="p161471753195920"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p314745313591"><a name="p314745313591"></a><a name="p314745313591"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p11147853145914"><a name="p11147853145914"></a><a name="p11147853145914"></a>Selected item in the current list. The value can be a <strong id="b19508174512249"><a name="b19508174512249"></a><a name="b19508174512249"></a>section</strong> value of any list items.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a> ## Attributes
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<a name="table1744514388541"></a> | Name | Type | Default Value | Mandatory | Description |
<table><thead align="left"><tr id="row1244614388545"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="ae8fba6e2bad749f49d7af2927756ecac"><a name="ae8fba6e2bad749f49d7af2927756ecac"></a><a name="ae8fba6e2bad749f49d7af2927756ecac"></a>Name</p> | --------------------------- | ---------------------------------------- | ------- | ---- | ---------------------------------------- |
</th> | scrollpage | boolean | false | No | Whether to scroll the non-list part on the top of the list page out of the visible area with the list. The value can be **true** (scrolls the non-list part out) or **false** (does not scroll the non-list part out). This attribute is not available when the direction is **row**.|
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="a4543b5564fb34df0b7d83c5640a46890"><a name="a4543b5564fb34df0b7d83c5640a46890"></a><a name="a4543b5564fb34df0b7d83c5640a46890"></a>Type</p> | cachedcount | number | 0 | No | Minimum number of cached list items when a long list is loaded with delay.<br>When the number of list items cached outside the visible area is less than the value of this attribute, a **requestitem** event is triggered.|
</th> | scrollbar | string | off | No | Display mode of the side scrollbar. (Currently, only the vertical scrollbar is supported.)<br>- **off**: no display.<br>- **auto**: displayed on demand (The side scrollbar is displayed when touched and disappears 2s later.).<br>- **on**: always displayed.|
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="a779ef1afb2d74c0fac0e8014dd85e120"><a name="a779ef1afb2d74c0fac0e8014dd85e120"></a><a name="a779ef1afb2d74c0fac0e8014dd85e120"></a>Default Value</p> | scrolleffect | string | spring | No | Scroll effect. Available values are as follows:<br>- **spring**: Similar to the physical dynamic effect of a spring. After scrolling to the edge, you can continue to scroll for a distance based on the initial speed or by touching the knob of the scrollbar. After you release your hand, the knob is rebounded.<br>- **fade**: Similar to the physical dynamic effect of fade. When you scroll to the edge, a wave shape fades. The fade changes according to the speed and scrolling distance.<br>- **no**: No effect after the scrollbar is moved to the edge.|
</th> | indexer | boolean \| Array&lt;string&gt; | false | No | Whether to display the alphabetical index bar on the sidebar. If this attribute is set to **true** or a customized indexer, the index bar is displayed at the right boundary of the list. Example:<br>**"indexer" : "true"** indicates the default alphabetical indexer.<br>**"indexer" : "false"** indicates no indexer.<br>"indexer": ['#', '1', '2', '3', '4', '5', '6', '7', '8'] indicates a customized index. You must include **"#"** when using a customized indexer.<br>This **indexer** attribute is valid only when **flex-direction** is set to **column** and **columns** is set to **1**.<br>This attribute must be used together with the **[section](../arkui-js/js-components-container-list-item.md#attributes)** attribute of **\<list-item>**.|
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p117421754619"><a name="p117421754619"></a><a name="p117421754619"></a>Mandatory</p> | indexercircle<sup>5+</sup> | boolean | - | No | Whether to use a circle indexer.<br>The default value is **true** for wearables and **false** for other device types. This attribute is invalid if **indexer** is set to **false**.|
</th> | indexermulti<sup>5+</sup> | boolean | false | No | Whether to use a multi-language indexer.<br>This attribute is invalid if **indexer** is set to **false**. |
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="aaed5c586aaf5480c8db9e53a6a22428c"><a name="aaed5c586aaf5480c8db9e53a6a22428c"></a><a name="aaed5c586aaf5480c8db9e53a6a22428c"></a>Description</p> | indexerbubble<sup>5+</sup> | boolean | true | No | Whether to display the bubble effect when switching among indexes.<br>This attribute is invalid if **indexer** is set to **false**. |
</th> | divider<sup>5+</sup> | boolean | false | No | Whether list items are separated by dividers.<br>For details about divider styles, see **divider-color**, **divider-height**, **divider-length**, and **divider-origin** in the **Styles** table.|
</tr> | shapemode | string | default | No | Shape of the side scrollbar.<br>- **default**: not specified (following the theme).<br>- **rect**: rectangle.<br>- **round**: circle.|
</thead> | updateeffect | boolean | false | No | Whether a dynamic effect is displayed when an item in the list is deleted or added.<br>- **false**: No dynamic effect is displayed.<br>- **true**: A dynamic effect is displayed when an item is added or deleted.|
<tbody><tr id="row194212174919"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p199724441985"><a name="p199724441985"></a><a name="p199724441985"></a>divider-color<sup id="sup3982558172012"><a name="sup3982558172012"></a><a name="sup3982558172012"></a>5+</sup></p> | chainanimation<sup>5+</sup> | boolean | false | No | Whether to display chained animations on this list when it slides or its top and bottom are dragged. The list items are separated with even space, and one item animation starts after the previous animation during basic sliding interactions. The chained animation effect is similar with spring physics.<br>- **false**: Chained animations are displayed.<br>- **true**: No chained animation is displayed.<br>Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated.<br>This attribute does not take effect if an indexer is used.<br>If this attribute is **true**, the **sticky** attributes set for **\<list-item>** components do not take effect.|
</td> | initialindex | number | 0 | No | Item displayed at the start position of the viewport when the current list is loaded for the first time. The default value is **0**, indicating that the first item is displayed. If the number you set is greater than the index of the last item, the setting does not take effect. When the **initialoffset** attribute is set, this attribute does not take effect. This attribute does not take effect if **indexer** or **scrollpage** is set to **true**.|
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p097214420817"><a name="p097214420817"></a><a name="p097214420817"></a>&lt;color&gt;</p> | initialoffset | &lt;length&gt; | 0 | No | Start offset of the viewport when the current list is loaded for the first time. The offset must not exceed the scrolling range of the current list. If exceeded, the offset is truncated to the maximum value of the scrolling range. This attribute does not take effect if **indexer** or **scrollpage** is set to **true**.|
</td> | selected<sup>5+</sup> | string | - | No | Selected item in the current list. The value can be a **section** value of any list items.|
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p2097211443820"><a name="p2097211443820"></a><a name="p2097211443820"></a>transparent</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p11972204415818"><a name="p11972204415818"></a><a name="p11972204415818"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1397215441382"><a name="p1397215441382"></a><a name="p1397215441382"></a>Item divider color. This style is valid only when the <strong id="b1297030161517"><a name="b1297030161517"></a><a name="b1297030161517"></a>divider</strong> attribute of <strong id="b5742145113148"><a name="b5742145113148"></a><a name="b5742145113148"></a>&lt;list&gt;</strong> is set to <strong id="b1358345714144"><a name="b1358345714144"></a><a name="b1358345714144"></a>true</strong>.</p>
</td>
</tr>
<tr id="row391641412910"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1098356680"><a name="p1098356680"></a><a name="p1098356680"></a>divider-height<sup id="sup19987635215"><a name="sup19987635215"></a><a name="sup19987635215"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p149835619814"><a name="p149835619814"></a><a name="p149835619814"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1498145614817"><a name="p1498145614817"></a><a name="p1498145614817"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p29815567820"><a name="p29815567820"></a><a name="p29815567820"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p10983561383"><a name="p10983561383"></a><a name="p10983561383"></a>Item divider height. This style is valid only when the <strong id="b11937127141512"><a name="b11937127141512"></a><a name="b11937127141512"></a>divider</strong> attribute of <strong id="b189375713157"><a name="b189375713157"></a><a name="b189375713157"></a>&lt;list&gt;</strong> is set to <strong id="b69387717151"><a name="b69387717151"></a><a name="b69387717151"></a>true</strong>.</p>
</td>
</tr>
<tr id="row28222110920"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1144015414911"><a name="p1144015414911"></a><a name="p1144015414911"></a>divider-length<sup id="sup5326118102117"><a name="sup5326118102117"></a><a name="sup5326118102117"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p3440174196"><a name="p3440174196"></a><a name="p3440174196"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p0440741193"><a name="p0440741193"></a><a name="p0440741193"></a>The main axis width</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p15440541997"><a name="p15440541997"></a><a name="p15440541997"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p10440341697"><a name="p10440341697"></a><a name="p10440341697"></a>Item divider length. If this style is not set, the maximum length is the width of the main axis, and the actual length depends on the <strong id="b11621155518258"><a name="b11621155518258"></a><a name="b11621155518258"></a>divider-origin</strong> parameter. This style is valid only when the <strong id="b68621714152610"><a name="b68621714152610"></a><a name="b68621714152610"></a>divider</strong> attribute of <strong id="b189911656201616"><a name="b189911656201616"></a><a name="b189911656201616"></a>&lt;list&gt;</strong> is set to <strong id="b1040015185263"><a name="b1040015185263"></a><a name="b1040015185263"></a>true</strong>.</p>
</td>
</tr>
<tr id="row46441281390"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1223216191395"><a name="p1223216191395"></a><a name="p1223216191395"></a>divider-origin<sup id="sup18714913122119"><a name="sup18714913122119"></a><a name="sup18714913122119"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p1232161919915"><a name="p1232161919915"></a><a name="p1232161919915"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p723231910913"><a name="p723231910913"></a><a name="p723231910913"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p3232141916912"><a name="p3232141916912"></a><a name="p3232141916912"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p42327191895"><a name="p42327191895"></a><a name="p42327191895"></a>Item divider offset relative to the start point of the main axis. This style is valid only when the <strong id="b194511311204618"><a name="b194511311204618"></a><a name="b194511311204618"></a>divider</strong> attribute of <strong id="b16151347170"><a name="b16151347170"></a><a name="b16151347170"></a>&lt;list&gt;</strong> is set to <strong id="b13844149467"><a name="b13844149467"></a><a name="b13844149467"></a>true</strong>.</p>
</td>
</tr>
<tr id="row39106404819"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p11283866482"><a name="p11283866482"></a><a name="p11283866482"></a>flex-direction</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p7283162488"><a name="p7283162488"></a><a name="p7283162488"></a>string</p>
<p id="p182831368480"><a name="p182831368480"></a><a name="p182831368480"></a></p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p0283762488"><a name="p0283762488"></a><a name="p0283762488"></a>column</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p172837614485"><a name="p172837614485"></a><a name="p172837614485"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p172837654814"><a name="p172837654814"></a><a name="p172837654814"></a>Main axis direction of the flex container. It specifies how items are placed in the flex container.</p>
<a name="ul132831763482"></a><a name="ul132831763482"></a><ul id="ul132831763482"><li><strong id="b195531457856"><a name="b195531457856"></a><a name="b195531457856"></a>column</strong>: The y-axis is the maim axis.</li><li><strong id="b1454210619720"><a name="b1454210619720"></a><a name="b1454210619720"></a>row</strong>: The x-axis is the main axis.</li></ul>
<p id="p132831263486"><a name="p132831263486"></a><a name="p132831263486"></a>For the <strong id="b587519315312"><a name="b587519315312"></a><a name="b587519315312"></a>&lt;list&gt;</strong> component, the default value is <strong id="b2766193510313"><a name="b2766193510313"></a><a name="b2766193510313"></a>column</strong>. For other components, the default value is <strong id="b1853133913313"><a name="b1853133913313"></a><a name="b1853133913313"></a>row</strong>. </p>
</td>
</tr>
<tr id="row114441253204717"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p192847684817"><a name="p192847684817"></a><a name="p192847684817"></a>columns</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p92848613481"><a name="p92848613481"></a><a name="p92848613481"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1928410616485"><a name="p1928410616485"></a><a name="p1928410616485"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p192844611485"><a name="p192844611485"></a><a name="p192844611485"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1928418624820"><a name="p1928418624820"></a><a name="p1928418624820"></a>Number of columns displayed in the cross axis direction of the list. The default value is <strong id="b106911824153820"><a name="b106911824153820"></a><a name="b106911824153820"></a>1</strong>.</p>
<div class="note" id="note87762014175811"><a name="note87762014175811"></a><a name="note87762014175811"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p157761214205810"><a name="p157761214205810"></a><a name="p157761214205810"></a>When multiple columns are set, the columns are evenly distributed on the cross axis of the <strong id="b20419145511271"><a name="b20419145511271"></a><a name="b20419145511271"></a>&lt;list&gt;</strong> component. The size of each column is the same.</p>
</div></div>
</td>
</tr>
<tr id="row2220195185518"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p12617942184311"><a name="p12617942184311"></a><a name="p12617942184311"></a>align-items</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p15617194264312"><a name="p15617194264312"></a><a name="p15617194264312"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p061744213433"><a name="p061744213433"></a><a name="p061744213433"></a>stretch</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p12617154214437"><a name="p12617154214437"></a><a name="p12617154214437"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p9617542124318"><a name="p9617542124318"></a><a name="p9617542124318"></a>Alignment of items in each column on the cross axis. Available values are as follows:</p>
<a name="ul166171442134312"></a><a name="ul166171442134312"></a><ul id="ul166171442134312"><li><strong id="b162552382282"><a name="b162552382282"></a><a name="b162552382282"></a>stretch</strong>: Items are stretched to the same height or width as the container in the cross axis direction. </li><li><strong id="b534154612815"><a name="b534154612815"></a><a name="b534154612815"></a>flex-start</strong>: Items are aligned to the start of the cross axis.</li><li><strong id="b12116104832812"><a name="b12116104832812"></a><a name="b12116104832812"></a>flex-end</strong>: Items are aligned to the end of the cross axis.</li><li><strong id="b16621855132813"><a name="b16621855132813"></a><a name="b16621855132813"></a>center</strong>: Items are aligned in the middle of the cross axis.<div class="note" id="note10891229703"><a name="note10891229703"></a><a name="note10891229703"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p18891029105"><a name="p18891029105"></a><a name="p18891029105"></a>This style takes effect only on items of each column. Columns are evenly distributed.</p>
</div></div>
</li></ul>
</td>
</tr>
<tr id="row487325034719"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p2028420617487"><a name="p2028420617487"></a><a name="p2028420617487"></a>item-extent</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p828496164810"><a name="p828496164810"></a><a name="p828496164810"></a>&lt;length&gt; | &lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p928413644818"><a name="p928413644818"></a><a name="p928413644818"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p2028416134815"><a name="p2028416134815"></a><a name="p2028416134815"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p18284660488"><a name="p18284660488"></a><a name="p18284660488"></a>Size of an internal item. When a percentage is set, the value indicates the percentage of the length in the main axis direction relative to the list viewpoint.</p>
</td>
</tr>
<tr id="row99041447114713"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p172840624815"><a name="p172840624815"></a><a name="p172840624815"></a>fade-color</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p132851863484"><a name="p132851863484"></a><a name="p132851863484"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1728506174819"><a name="p1728506174819"></a><a name="p1728506174819"></a>grey</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p22852060481"><a name="p22852060481"></a><a name="p22852060481"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p428518694818"><a name="p428518694818"></a><a name="p428518694818"></a>Color of the physical dynamic effect. This attribute is valid only when <strong id="b1640719118429"><a name="b1640719118429"></a><a name="b1640719118429"></a>scrolleffect</strong> is set to <strong id="b1941331114423"><a name="b1941331114423"></a><a name="b1941331114423"></a>fade</strong>.</p>
</td>
</tr>
<tr id="row023410442716"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p829911534213"><a name="p829911534213"></a><a name="p829911534213"></a>scrollbar-color<sup id="sup843916381239"><a name="sup843916381239"></a><a name="sup843916381239"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p122991553112113"><a name="p122991553112113"></a><a name="p122991553112113"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p17299253132120"><a name="p17299253132120"></a><a name="p17299253132120"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p9299135342110"><a name="p9299135342110"></a><a name="p9299135342110"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p14300165317215"><a name="p14300165317215"></a><a name="p14300165317215"></a>Color of the scrollbar.</p>
</td>
</tr>
<tr id="row1117810274"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1433575912212"><a name="p1433575912212"></a><a name="p1433575912212"></a>scrollbar-width<sup id="sup10700174022317"><a name="sup10700174022317"></a><a name="sup10700174022317"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p3335165919217"><a name="p3335165919217"></a><a name="p3335165919217"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p6335175914219"><a name="p6335175914219"></a><a name="p6335175914219"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p13335759172115"><a name="p13335759172115"></a><a name="p13335759172115"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p533510595217"><a name="p533510595217"></a><a name="p533510595217"></a>Width of the scrollbar.</p>
</td>
</tr>
<tr id="row11452128142314"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p99726914238"><a name="p99726914238"></a><a name="p99726914238"></a>scrollbar-offset<sup id="sup697216902311"><a name="sup697216902311"></a><a name="sup697216902311"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p119725918233"><a name="p119725918233"></a><a name="p119725918233"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p79725972313"><a name="p79725972313"></a><a name="p79725972313"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1297210918239"><a name="p1297210918239"></a><a name="p1297210918239"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p17972694239"><a name="p17972694239"></a><a name="p17972694239"></a>Offset between the scrollbar and the default position of the list. The value must be a positive number. The default position is on the right edge of the list. You can adjust the horizontal position of the scrollbar by setting this offset. If the scrollbar is drawn outside the list and the parent component of the list is capable of cropping, the scrollbar will be cropped.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section471854810515"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. ## Styles
<a name="table12718648205119"></a> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
<table><thead align="left"><tr id="row17185480518"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p14718114825114"><a name="p14718114825114"></a><a name="p14718114825114"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="p137181948105111"><a name="p137181948105111"></a><a name="p137181948105111"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="p18718164812518"><a name="p18718164812518"></a><a name="p18718164812518"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row0718194813519"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p971894825110"><a name="p971894825110"></a><a name="p971894825110"></a>indexerchange<sup id="sup27189486514"><a name="sup27189486514"></a><a name="sup27189486514"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p197191148155114"><a name="p197191148155114"></a><a name="p197191148155114"></a>{ local: booleanValue }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1871920489510"><a name="p1871920489510"></a><a name="p1871920489510"></a>Triggered when the indexer switches between local and alphabetic indexers. This parameter takes effect only when both <strong id="b16937844815"><a name="b16937844815"></a><a name="b16937844815"></a>indexer</strong> and <strong id="b239116138814"><a name="b239116138814"></a><a name="b239116138814"></a>indexermulti</strong> are set to <strong id="b14371161515817"><a name="b14371161515817"></a><a name="b14371161515817"></a>true</strong>. The value of <strong id="b122409572813"><a name="b122409572813"></a><a name="b122409572813"></a>booleanValue</strong> can be:</p>
<a name="ul18719104820516"></a><a name="ul18719104820516"></a><ul id="ul18719104820516"><li><strong id="b6542135618131"><a name="b6542135618131"></a><a name="b6542135618131"></a>true</strong>: The local index is displayed.</li><li><strong id="b17362155812135"><a name="b17362155812135"></a><a name="b17362155812135"></a>false</strong>: The alphabetic index is displayed.</li></ul>
</td>
</tr>
<tr id="row4719114805113"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p157191048155110"><a name="p157191048155110"></a><a name="p157191048155110"></a>scroll</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p177191548175111"><a name="p177191548175111"></a><a name="p177191548175111"></a>{ scrollX: scrollXValue, scrollY: scrollYValue, scrollState: stateValue }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1571914895114"><a name="p1571914895114"></a><a name="p1571914895114"></a>Triggered to indicate the offset and status of list scrolling.</p>
<p id="p13719164815112"><a name="p13719164815112"></a><a name="p13719164815112"></a><strong id="b19254154542413"><a name="b19254154542413"></a><a name="b19254154542413"></a>stateValue: 0</strong>: The list is not scrolling.</p>
<p id="p1719154885113"><a name="p1719154885113"></a><a name="p1719154885113"></a><strong id="b679923542516"><a name="b679923542516"></a><a name="b679923542516"></a>stateValue: 1</strong>: The list is scrolling along with user's touches.</p>
<p id="p8719148105112"><a name="p8719148105112"></a><a name="p8719148105112"></a><strong id="b6111123911267"><a name="b6111123911267"></a><a name="b6111123911267"></a>stateValue: 2</strong>: The list is scrolling after the touches stop.</p>
</td>
</tr>
<tr id="row1371954819511"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p671984817514"><a name="p671984817514"></a><a name="p671984817514"></a>scrollbottom </p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1971944810515"><a name="p1971944810515"></a><a name="p1971944810515"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p371984855113"><a name="p371984855113"></a><a name="p371984855113"></a>Triggered when the list is scrolled to the bottom.</p>
</td>
</tr>
<tr id="row1671944812519"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p971919481515"><a name="p971919481515"></a><a name="p971919481515"></a>scrolltop </p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p12719348135112"><a name="p12719348135112"></a><a name="p12719348135112"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p127193483517"><a name="p127193483517"></a><a name="p127193483517"></a>Triggered when the list is scrolled to the top.</p>
</td>
</tr>
<tr id="row17209489513"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p672034817518"><a name="p672034817518"></a><a name="p672034817518"></a>scrollend</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p67202487511"><a name="p67202487511"></a><a name="p67202487511"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1472054895112"><a name="p1472054895112"></a><a name="p1472054895112"></a>Triggered when the list stops scrolling.</p>
</td>
</tr>
<tr id="row27207484515"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p67201048125114"><a name="p67201048125114"></a><a name="p67201048125114"></a>scrolltouchup </p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1720164814510"><a name="p1720164814510"></a><a name="p1720164814510"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p17720548105118"><a name="p17720548105118"></a><a name="p17720548105118"></a>Triggered when the list continues scrolling after the user lifts their fingers.</p>
</td>
</tr>
<tr id="row18720104812512"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p14720174820515"><a name="p14720174820515"></a><a name="p14720174820515"></a>requestitem </p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p572034875112"><a name="p572034875112"></a><a name="p572034875112"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p272034815115"><a name="p272034815115"></a><a name="p272034815115"></a>Triggered for a request to create a list-item.</p>
<p id="p1372014820516"><a name="p1372014820516"></a><a name="p1372014820516"></a>This event is triggered when the number of cached list-items outside the visible area is less than the value of <strong id="b1137011348317"><a name="b1137011348317"></a><a name="b1137011348317"></a>cachedcount</strong> during long list loading with delay.</p>
</td>
</tr>
<tr id="row16353171781416"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p13354161718142"><a name="p13354161718142"></a><a name="p13354161718142"></a>rotate<sup id="sup915919368206"><a name="sup915919368206"></a><a name="sup915919368206"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1135419179146"><a name="p1135419179146"></a><a name="p1135419179146"></a>{ rotateValue: number }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1835471721415"><a name="p1835471721415"></a><a name="p1835471721415"></a>Triggered to indicate the incremental value of the rotation angle of the watch crown. This parameter is only supported by wearables.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section47669296127"></a> | Name | Type | Default Value | Mandatory | Description |
| ----------------------------- | ---------------------------------------- | ----------- | ---- | ---------------------------------------- |
| divider-color<sup>5+</sup> | &lt;color&gt; | transparent | No | Item divider color. This style is valid only when the **divider** attribute of **<list>** is set to **true**. |
| divider-height<sup>5+</sup> | &lt;length&gt; | 1 | No | Item divider height. This style is valid only when the **divider** attribute of **<list>** is set to **true**. |
| divider-length<sup>5+</sup> | &lt;length&gt; | Main axis width | No | Item divider length. If this style is not set, the maximum length is the width of the main axis, and the actual length depends on the **divider-origin** parameter. This style is valid only when the **divider** attribute of **\<list>** is set to **true**.|
| divider-origin<sup>5+</sup> | &lt;length&gt; | 0 | No | Item divider offset relative to the start point of the main axis. This style is valid only when the **divider** attribute of **\<list>** is set to **true**.|
| flex-direction | string | column | No | Main axis direction of the flex container. It specifies how items are placed in the flex container.<br>- **column**: The y-axis is the main axis.<br>- **row**: The x-axis is the main axis.<br>For the **\<list>** component, the default value is **column**. For other components, the default value is **row**.|
| columns | number | 1 | No | Number of columns displayed in the cross axis direction of the list. The default value is **1**.<br>When multiple columns are set, the columns are evenly distributed on the cross axis of the **\<list>** component. The size of each column is the same.|
| align-items | string | stretch | No | Alignment of items in each column on the cross axis. Available values are as follows:<br>- **stretch**: Items are stretched to the same height or width as the container in the cross axis direction.<br>- **flex-start**: Items are aligned to the start of the cross axis.<br>- **flex-end**: Items are aligned to the end of the cross axis.<br>- **center**: Items are aligned in the center of the cross axis.<br>This style takes effect only on items of each column. Columns are evenly distributed.|
| item-extent | &lt;length&gt; \| &lt;percentage&gt; | - | No | Size of an internal item. When a percentage is set, the value indicates the percentage of the length in the main axis direction relative to the list viewpoint.|
| fade-color | &lt;color&gt; | grey | No | Color of the physical dynamic effect. This attribute is valid only when **scrolleffect** is set to **fade**. |
| scrollbar-color<sup>6+</sup> | &lt;color&gt; | - | No | Color of the scrollbar. |
| scrollbar-width<sup>6+</sup> | &lt;length&gt; | - | No | Width of the scrollbar. |
| scrollbar-offset<sup>6+</sup> | &lt;length&gt; | 0 | No | Offset between the scrollbar and the default position of the list. The value must be a positive number. The default position is on the right edge of the list. You can adjust the horizontal position of the scrollbar by setting this offset. If the scrollbar is drawn outside the list and the parent component of the list is capable of cropping, the scrollbar will be cropped.|
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported.
<a name="t0c307a0cf3734cb28f3adf6af246a486"></a> ## Events
<table><thead align="left"><tr id="r83b0c5b4f4b54874b1b3d7a36bcfa36b"><th class="cellrowborder" valign="top" width="14.09%" id="mcps1.1.4.1.1"><p id="af4002018158a424c9fe9ad1a0e8a395f"><a name="af4002018158a424c9fe9ad1a0e8a395f"></a><a name="af4002018158a424c9fe9ad1a0e8a395f"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="34.910000000000004%" id="mcps1.1.4.1.2"><p id="a08987b2b1bc34babb92dd601235b0e24"><a name="a08987b2b1bc34babb92dd601235b0e24"></a><a name="a08987b2b1bc34babb92dd601235b0e24"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="51%" id="mcps1.1.4.1.3"><p id="a5e3e3d76323a4ebe96e1bdb1d1c338eb"><a name="a5e3e3d76323a4ebe96e1bdb1d1c338eb"></a><a name="a5e3e3d76323a4ebe96e1bdb1d1c338eb"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r6eb16143d32645c2ae58f1e4857b0d99"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="a16f9fd69364541c3bf57f9b2305ba51f"><a name="a16f9fd69364541c3bf57f9b2305ba51f"></a><a name="a16f9fd69364541c3bf57f9b2305ba51f"></a>scrollTo</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="abfb4febc1ae4429b8f593e96c50c9bc7"><a name="abfb4febc1ae4429b8f593e96c50c9bc7"></a><a name="abfb4febc1ae4429b8f593e96c50c9bc7"></a>{ index: number(specified position) }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="a75c53230ef704966b5b25d2e2606584f"><a name="a75c53230ef704966b5b25d2e2606584f"></a><a name="a75c53230ef704966b5b25d2e2606584f"></a>Scrolls the list to the position of the item at the specified index.</p>
</td>
</tr>
<tr id="r9c30e9310fb349a4bf157e92668927fc"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="a8ce0c025f94046a89cfe7a3d4e20d802"><a name="a8ce0c025f94046a89cfe7a3d4e20d802"></a><a name="a8ce0c025f94046a89cfe7a3d4e20d802"></a>scrollBy</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="ae74f4613d9a44d7f890b38e10b61e249"><a name="ae74f4613d9a44d7f890b38e10b61e249"></a><a name="ae74f4613d9a44d7f890b38e10b61e249"></a><a href="#t54327f53ea104788bc430b9047ecb47b">ScrollParam</a></p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="a5a3997da89d649f0ac1c71461d953294"><a name="a5a3997da89d649f0ac1c71461d953294"></a><a name="a5a3997da89d649f0ac1c71461d953294"></a>Scrolls the list for a certain distance.</p>
<p id="a0767362b2b4a4535a06cb42e483b14cd"><a name="a0767362b2b4a4535a06cb42e483b14cd"></a><a name="a0767362b2b4a4535a06cb42e483b14cd"></a>This method applies only to smart TVs.</p>
</td>
</tr>
<tr id="row10674141618528"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p1166501614521"><a name="p1166501614521"></a><a name="p1166501614521"></a>scrollTop</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p13665201655211"><a name="p13665201655211"></a><a name="p13665201655211"></a>{ smooth: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p1466520168521"><a name="p1466520168521"></a><a name="p1466520168521"></a>If <strong id="b984720142292"><a name="b984720142292"></a><a name="b984720142292"></a>smooth</strong> is set to <strong id="b2026210453280"><a name="b2026210453280"></a><a name="b2026210453280"></a>false</strong> (default value), the list is directly scrolled to the top.</p>
<p id="p1166519160524"><a name="p1166519160524"></a><a name="p1166519160524"></a>If <strong id="b3593012162913"><a name="b3593012162913"></a><a name="b3593012162913"></a>smooth</strong> is set to <strong id="b1085141612919"><a name="b1085141612919"></a><a name="b1085141612919"></a>true</strong>, the list is smoothly scrolled to the top.</p>
</td>
</tr>
<tr id="row1067461665217"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p96651616195214"><a name="p96651616195214"></a><a name="p96651616195214"></a>scrollBottom</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p566501617522"><a name="p566501617522"></a><a name="p566501617522"></a>{ smooth: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p1966571635219"><a name="p1966571635219"></a><a name="p1966571635219"></a>If <strong id="b1850718335307"><a name="b1850718335307"></a><a name="b1850718335307"></a>smooth</strong> is set to <strong id="b155131133173012"><a name="b155131133173012"></a><a name="b155131133173012"></a>false</strong> (default value), the list is directly scrolled to the bottom.</p>
<p id="p1566513161529"><a name="p1566513161529"></a><a name="p1566513161529"></a>If <strong id="b92856582554"><a name="b92856582554"></a><a name="b92856582554"></a>smooth</strong> is set to <strong id="b1285858195517"><a name="b1285858195517"></a><a name="b1285858195517"></a>true</strong>, the list is smoothly scrolled to the bottom.</p>
</td>
</tr>
<tr id="row667481665218"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p966520161520"><a name="p966520161520"></a><a name="p966520161520"></a>scrollPage</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p1166551610522"><a name="p1166551610522"></a><a name="p1166551610522"></a>{ reverse: boolean, smooth: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p156651016205211"><a name="p156651016205211"></a><a name="p156651016205211"></a>If <strong id="b4550185811294"><a name="b4550185811294"></a><a name="b4550185811294"></a>reverse</strong> is set to <strong id="b117247306"><a name="b117247306"></a><a name="b117247306"></a>false</strong> (default value), the next page is displayed. If there is no next page, the list scrolls to the bottom.</p>
<p id="p11665141617522"><a name="p11665141617522"></a><a name="p11665141617522"></a>If <strong id="b930919101316"><a name="b930919101316"></a><a name="b930919101316"></a>reverse</strong> is set to <strong id="b143091510103117"><a name="b143091510103117"></a><a name="b143091510103117"></a>true</strong>, the previous page is displayed. If there is no previous page, the list scrolls to the top.</p>
<p id="p466513161522"><a name="p466513161522"></a><a name="p466513161522"></a>If <strong id="b21022056123111"><a name="b21022056123111"></a><a name="b21022056123111"></a>smooth</strong> is set to <strong id="b16107155643115"><a name="b16107155643115"></a><a name="b16107155643115"></a>false</strong> (default value), the list is directly scrolled to another page.</p>
<p id="p5665131615528"><a name="p5665131615528"></a><a name="p5665131615528"></a>If <strong id="b115833242327"><a name="b115833242327"></a><a name="b115833242327"></a>smooth</strong> is set to <strong id="b1058832493214"><a name="b1058832493214"></a><a name="b1058832493214"></a>true</strong>, the list is smoothly scrolled to another page.</p>
</td>
</tr>
<tr id="row13674616205216"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p176652164528"><a name="p176652164528"></a><a name="p176652164528"></a>scrollArrow</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p166513161529"><a name="p166513161529"></a><a name="p166513161529"></a>{ reverse: boolean, smooth: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p1966551617521"><a name="p1966551617521"></a><a name="p1966551617521"></a>If <strong id="b1549291018335"><a name="b1549291018335"></a><a name="b1549291018335"></a>reverse</strong> is set to <strong id="b20492111023311"><a name="b20492111023311"></a><a name="b20492111023311"></a>false</strong> (default value), the list scrolls towards the bottom for a certain distance. If there is no sufficient distance, the list scrolls to the bottom.</p>
<p id="p266511168524"><a name="p266511168524"></a><a name="p266511168524"></a>If <strong id="b5940743113413"><a name="b5940743113413"></a><a name="b5940743113413"></a>reverse</strong> is set to <strong id="b5940243133413"><a name="b5940243133413"></a><a name="b5940243133413"></a>true</strong>, the list scrolls towards the top for a certain distance. If there is no sufficient distance, the list scrolls to the top.</p>
<p id="p466510161529"><a name="p466510161529"></a><a name="p466510161529"></a>If <strong id="b3360148173519"><a name="b3360148173519"></a><a name="b3360148173519"></a>smooth</strong> is set to <strong id="b436188123520"><a name="b436188123520"></a><a name="b436188123520"></a>false</strong> (default value), the list is directly scrolled.</p>
<p id="p966561612526"><a name="p966561612526"></a><a name="p966561612526"></a>If <strong id="b914072419593"><a name="b914072419593"></a><a name="b914072419593"></a>smooth</strong> is set to <strong id="b5146224175917"><a name="b5146224175917"></a><a name="b5146224175917"></a>true</strong>, the list is smoothly scrolled.</p>
</td>
</tr>
<tr id="row146741516135215"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p16666161613523"><a name="p16666161613523"></a><a name="p16666161613523"></a>collapseGroup</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p466641685216"><a name="p466641685216"></a><a name="p466641685216"></a>{ groupid: string }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p206661165523"><a name="p206661165523"></a><a name="p206661165523"></a>Collapses a group.</p>
<p id="p15666516205215"><a name="p15666516205215"></a><a name="p15666516205215"></a><strong id="b15480175617355"><a name="b15480175617355"></a><a name="b15480175617355"></a>groupid</strong>: ID of the group to collapse.</p>
<p id="p1566613167526"><a name="p1566613167526"></a><a name="p1566613167526"></a>All groups are collapsed when <strong id="b717013733612"><a name="b717013733612"></a><a name="b717013733612"></a>groupid</strong> is not specified.</p>
</td>
</tr>
<tr id="row2674171665212"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p16666716155214"><a name="p16666716155214"></a><a name="p16666716155214"></a>expandGroup</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p1466681665219"><a name="p1466681665219"></a><a name="p1466681665219"></a>{ groupid: string }</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p11666816135210"><a name="p11666816135210"></a><a name="p11666816135210"></a>Expands a group.</p>
<p id="p1766615169528"><a name="p1766615169528"></a><a name="p1766615169528"></a><strong id="b15511066374"><a name="b15511066374"></a><a name="b15511066374"></a>groupid</strong>: ID of the group to expand.</p>
<p id="p1766616164528"><a name="p1766616164528"></a><a name="p1766616164528"></a>All groups are expanded when <strong id="b692019124376"><a name="b692019124376"></a><a name="b692019124376"></a>groupid</strong> is not specified.</p>
</td>
</tr>
<tr id="row9562194955312"><td class="cellrowborder" valign="top" width="14.09%" headers="mcps1.1.4.1.1 "><p id="p4562174912536"><a name="p4562174912536"></a><a name="p4562174912536"></a>currentOffset</p>
</td>
<td class="cellrowborder" valign="top" width="34.910000000000004%" headers="mcps1.1.4.1.2 "><p id="p5562449185318"><a name="p5562449185318"></a><a name="p5562449185318"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.1.4.1.3 "><p id="p8563144914534"><a name="p8563144914534"></a><a name="p8563144914534"></a>Returns the offset of the current scrolling. The return value type is <strong id="b619148183811"><a name="b619148183811"></a><a name="b619148183811"></a>Object</strong>. For details, see <a href="#table1145513617576">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** ScrollParam In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
<a name="t54327f53ea104788bc430b9047ecb47b"></a> | Name | Parameter | Description |
<table><thead align="left"><tr id="r6bc769560d884ebca11d7ef155cfc00c"><th class="cellrowborder" valign="top" width="12.000000000000002%" id="mcps1.2.6.1.1"><p id="a2b340d5b063045f9b972339877932f7d"><a name="a2b340d5b063045f9b972339877932f7d"></a><a name="a2b340d5b063045f9b972339877932f7d"></a>Name</p> | -------------------------- | ---------------------------------------- | ---------------------------------------- |
</th> | indexerchange<sup>5+</sup> | { local: booleanValue } | Triggered when the indexer switches between local and alphabetic indexers. This parameter takes effect only when both **indexer** and **indexermulti** are set to **true**. The values of **booleanValue** can be:<br>- **true**: The local index is displayed.<br>- **false**: The alphabetic index is displayed.|
<th class="cellrowborder" valign="top" width="22.000000000000004%" id="mcps1.2.6.1.2"><p id="a9710da1e083c4c4980317ab1772446a1"><a name="a9710da1e083c4c4980317ab1772446a1"></a><a name="a9710da1e083c4c4980317ab1772446a1"></a>Type</p> | scroll | { scrollX: scrollXValue, scrollY: scrollYValue, scrollState: stateValue } | Triggered to indicate the offset and status of list scrolling.<br>**stateValue: 0**: The list is not scrolling.<br>**stateValue: 1**: The list is scrolling along with user's touches.<br>**stateValue: 2**: The list is scrolling after the touches stop.|
</th> | scrollbottom | - | Triggered when the list is scrolled to the bottom. |
<th class="cellrowborder" valign="top" width="24.000000000000004%" id="mcps1.2.6.1.3"><p id="a273155109e9b41b1876c7b4944800ee4"><a name="a273155109e9b41b1876c7b4944800ee4"></a><a name="a273155109e9b41b1876c7b4944800ee4"></a>Mandatory</p> | scrolltop | - | Triggered when the list is scrolled to the top. |
</th> | scrollend | - | Triggered when the list stops scrolling. |
<th class="cellrowborder" valign="top" width="21.000000000000004%" id="mcps1.2.6.1.4"><p id="ae31408099fa24514bac47cf09a9e7b1a"><a name="ae31408099fa24514bac47cf09a9e7b1a"></a><a name="ae31408099fa24514bac47cf09a9e7b1a"></a>Default Value</p> | scrolltouchup | - | Triggered when the list continues scrolling after the user lifts their fingers. |
</th> | requestitem | - | Triggered for a request to create a list-item.<br>This event is triggered when the number of cached list-items outside the visible area is less than the value of **cachedcount** during long list loading with delay.|
<th class="cellrowborder" valign="top" width="21.000000000000004%" id="mcps1.2.6.1.5"><p id="a333063706a09429cbe9ac81130d2b6cc"><a name="a333063706a09429cbe9ac81130d2b6cc"></a><a name="a333063706a09429cbe9ac81130d2b6cc"></a>Remarks</p> | rotate<sup>7+</sup> | { rotateValue: number } | Triggered to indicate the incremental value of the rotation angle of the watch crown. This parameter is only supported by wearables. |
</th>
</tr>
</thead>
<tbody><tr id="r6d4c75c9670d49ada849ec9f6bef83dd"><td class="cellrowborder" valign="top" width="12.000000000000002%" headers="mcps1.2.6.1.1 "><p id="ac4d9ce9a62d9442cb65658878f44e018"><a name="ac4d9ce9a62d9442cb65658878f44e018"></a><a name="ac4d9ce9a62d9442cb65658878f44e018"></a>dx</p>
</td>
<td class="cellrowborder" valign="top" width="22.000000000000004%" headers="mcps1.2.6.1.2 "><p id="aa6b8f1f0155a4954aab3a9609cadaf3a"><a name="aa6b8f1f0155a4954aab3a9609cadaf3a"></a><a name="aa6b8f1f0155a4954aab3a9609cadaf3a"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="24.000000000000004%" headers="mcps1.2.6.1.3 "><p id="a95db84bc6a774d029883ad1abae2d022"><a name="a95db84bc6a774d029883ad1abae2d022"></a><a name="a95db84bc6a774d029883ad1abae2d022"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.4 "><p id="aaa6df3c43c9b47bf81b339edcae98840"><a name="aaa6df3c43c9b47bf81b339edcae98840"></a><a name="aaa6df3c43c9b47bf81b339edcae98840"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.5 "><p id="aaffe44e874d74b6297ea7841258cb941"><a name="aaffe44e874d74b6297ea7841258cb941"></a><a name="aaffe44e874d74b6297ea7841258cb941"></a>Offset for scrolling the list in the horizontal direction, in px.</p>
</td>
</tr>
<tr id="rf56d36eb7a184adc843f20b499344ed6"><td class="cellrowborder" valign="top" width="12.000000000000002%" headers="mcps1.2.6.1.1 "><p id="acb8223e7297d4dbfa243b4b974c92560"><a name="acb8223e7297d4dbfa243b4b974c92560"></a><a name="acb8223e7297d4dbfa243b4b974c92560"></a>dy</p>
</td>
<td class="cellrowborder" valign="top" width="22.000000000000004%" headers="mcps1.2.6.1.2 "><p id="aa88695593f93485a9b64158a7e05cda4"><a name="aa88695593f93485a9b64158a7e05cda4"></a><a name="aa88695593f93485a9b64158a7e05cda4"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="24.000000000000004%" headers="mcps1.2.6.1.3 "><p id="a08e26d1dfd3e406b849dfaa715b0e985"><a name="a08e26d1dfd3e406b849dfaa715b0e985"></a><a name="a08e26d1dfd3e406b849dfaa715b0e985"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.4 "><p id="aede3e64e10724335b9297743fece7e4a"><a name="aede3e64e10724335b9297743fece7e4a"></a><a name="aede3e64e10724335b9297743fece7e4a"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.5 "><p id="ade99317ad7354fee8e88ca282cf70446"><a name="ade99317ad7354fee8e88ca282cf70446"></a><a name="ade99317ad7354fee8e88ca282cf70446"></a>Offset for scrolling the list in the vertical direction, in px.</p>
</td>
</tr>
<tr id="r69d5b3d9c60a4a5ea242be132f754948"><td class="cellrowborder" valign="top" width="12.000000000000002%" headers="mcps1.2.6.1.1 "><p id="ae0636046822644c7b7a5289fbbcd53e6"><a name="ae0636046822644c7b7a5289fbbcd53e6"></a><a name="ae0636046822644c7b7a5289fbbcd53e6"></a>smooth</p>
</td>
<td class="cellrowborder" valign="top" width="22.000000000000004%" headers="mcps1.2.6.1.2 "><p id="a7d930786d83a4f9f92a4ba4e6cbb9db0"><a name="a7d930786d83a4f9f92a4ba4e6cbb9db0"></a><a name="a7d930786d83a4f9f92a4ba4e6cbb9db0"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="24.000000000000004%" headers="mcps1.2.6.1.3 "><p id="a643ff67584184620885e6ee1fddee8cb"><a name="a643ff67584184620885e6ee1fddee8cb"></a><a name="a643ff67584184620885e6ee1fddee8cb"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.4 "><p id="ac86052e652c54edead6588ad0932a118"><a name="ac86052e652c54edead6588ad0932a118"></a><a name="ac86052e652c54edead6588ad0932a118"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.6.1.5 "><p id="a1a8906b49d5e48f98a068f339df880e9"><a name="a1a8906b49d5e48f98a068f339df880e9"></a><a name="a1a8906b49d5e48f98a068f339df880e9"></a>Whether a sliding animation is displayed when the list position is changed.</p>
</td>
</tr>
</tbody>
</table>
**Table 2** Attributes of the currentOffset return object
<a name="table1145513617576"></a> ## Methods
<table><thead align="left"><tr id="row1445543665717"><th class="cellrowborder" valign="top" width="21.82%" id="mcps1.2.4.1.1"><p id="p0455183695711"><a name="p0455183695711"></a><a name="p0455183695711"></a>Name</p>
</th> In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
<th class="cellrowborder" valign="top" width="40%" id="mcps1.2.4.1.2"><p id="p2045533685711"><a name="p2045533685711"></a><a name="p2045533685711"></a>Type</p>
</th> | Name | Parameter | Description |
<th class="cellrowborder" valign="top" width="38.18%" id="mcps1.2.4.1.3"><p id="p144557363572"><a name="p144557363572"></a><a name="p144557363572"></a>Remarks</p> | ------------- | ---------------------------------------- | ---------------------------------------- |
</th> | scrollTo | { index: number(specified position) } | Scrolls the list to the position of the item at the specified index. |
</tr> | scrollTop | { smooth: boolean } | If **smooth** is set to **false** (default value), the list is directly scrolled to the top.<br>If **smooth** is set to **true**, the list is smoothly scrolled to the top.|
</thead> | scrollBottom | { smooth: boolean } | If **smooth** is set to **false** (default value), the list is directly scrolled to the bottom.<br>If **smooth** is set to **true**, the list is smoothly scrolled to the bottom.|
<tbody><tr id="row545516365576"><td class="cellrowborder" valign="top" width="21.82%" headers="mcps1.2.4.1.1 "><p id="p6455136135712"><a name="p6455136135712"></a><a name="p6455136135712"></a>x</p> | scrollPage | { reverse: boolean, smooth: boolean } | If **reverse** is set to **false** (default value), the next page is displayed. If there is no next page, the list scrolls to the bottom.<br>If **reverse** is set to **true**, the previous page is displayed. If there is no previous page, the list scrolls to the top.<br>If **smooth** is set to **false** (default value), the list is directly scrolled to another page.<br>If **smooth** is set to **true**, the list is smoothly scrolled to another page.|
</td> | scrollArrow | { reverse: boolean, smooth: boolean } | If **reverse** is set to **false** (default value), the list scrolls towards the bottom for a certain distance. If there is no sufficient distance, the list scrolls to the bottom.<br>If **reverse** is set to **true**, the list scrolls towards the top for a certain distance. If there is no sufficient distance, the list scrolls to the top.<br>If **smooth** is set to **false** (default value), the list is directly scrolled.<br>If **smooth** is set to **true**, the list is smoothly scrolled.|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.2.4.1.2 "><p id="p14456113625711"><a name="p14456113625711"></a><a name="p14456113625711"></a>number</p> | collapseGroup | { groupid: string } | Collapses a group.<br>**groupid**: ID of the group to collapse.<br>All groups are collapsed when **groupid** is not specified.|
</td> | expandGroup | { groupid: string } | Expands a group.<br>**groupid**: ID of the group to expand.<br>All groups are expanded when **groupid** is not specified.|
<td class="cellrowborder" valign="top" width="38.18%" headers="mcps1.2.4.1.3 "><p id="p19456436165717"><a name="p19456436165717"></a><a name="p19456436165717"></a>Scrolling offset in the x-axis, in px</p> | currentOffset | - | Returns the offset of the current scrolling. The return value type is Object. For details, see **currentOffset**.|
</td>
</tr> **Table 1** currentOffset
<tr id="row134561936125711"><td class="cellrowborder" valign="top" width="21.82%" headers="mcps1.2.4.1.1 "><p id="p194561736145714"><a name="p194561736145714"></a><a name="p194561736145714"></a>y</p>
</td> | Name | Type | Remarks |
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.2.4.1.2 "><p id="p1345612364579"><a name="p1345612364579"></a><a name="p1345612364579"></a>number</p> | ---- | ------ | ---------------- |
</td> | x | number | Scrolling offset in the x-axis, in px|
<td class="cellrowborder" valign="top" width="38.18%" headers="mcps1.2.4.1.3 "><p id="p1144122515599"><a name="p1144122515599"></a><a name="p1144122515599"></a>Scrolling offset in the y-axis, in px</p> | y | number | Scrolling offset in the y-axis, in px|
</td>
</tr>
</tbody>
</table>
## Example ## Example
``` ```html
<!-- index.hml --> <!-- index.hml -->
<div class="container"> <div class="container">
<list class="todo-wrapper"> <list class="todo-wrapper">
...@@ -638,7 +113,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods. ...@@ -638,7 +113,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods.
</div> </div>
``` ```
``` ```js
// index.js // index.js
export default { export default {
data: { data: {
...@@ -653,7 +128,7 @@ export default { ...@@ -653,7 +128,7 @@ export default {
} }
``` ```
``` ```css
/* index.css */ /* index.css */
.container { .container {
display: flex; display: flex;
...@@ -678,4 +153,4 @@ export default { ...@@ -678,4 +153,4 @@ export default {
} }
``` ```
![en-us_image_0000001185033226](figures/en-us_image_0000001185033226.png) ![en-us_image_0000001185033226](figures/en-us_image_0000001185033226.png)
\ No newline at end of file
# panel<a name="EN-US_TOPIC_0000001127284828"></a> # panel
The **<panel\>** component is a slidable panel. It provides a lightweight content display window with flexible sizes. The **<panel\>** component pops up when it is displayed. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Child Components<a name="section19368335134016"></a> The **\<panel>** component is a slidable, pop-up component that provides a lightweight content display window with flexible sizes.
Yes
## Attributes<a name="section1100152194018"></a> ## Child Components
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. Supported
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.43%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Triggered when</p>
</th>
</tr>
</thead>
<tbody><tr id="row741201424216"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1555482064215"><a name="p1555482064215"></a><a name="p1555482064215"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p195541120124212"><a name="p195541120124212"></a><a name="p195541120124212"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p05541220194219"><a name="p05541220194219"></a><a name="p05541220194219"></a>foldable</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p155541220104216"><a name="p155541220104216"></a><a name="p155541220104216"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p175541420104219"><a name="p175541420104219"></a><a name="p175541420104219"></a>Type of the slidable panel. This attribute cannot be dynamically changed. Available values are as follows:</p>
<a name="ul15554620204219"></a><a name="ul15554620204219"></a><ul id="ul15554620204219"><li><p id="p555417208423"><a name="p555417208423"></a><a name="p555417208423"></a><strong id="b75944818331"><a name="b75944818331"></a><a name="b75944818331"></a>minibar</strong>: A minibar panel displays content in the minibar area or a large (fullscreen-like) area.</p>
</li><li><p id="p15554920204216"><a name="p15554920204216"></a><a name="p15554920204216"></a><strong id="b1346141143510"><a name="b1346141143510"></a><a name="b1346141143510"></a>foldable</strong>: A foldable panel displays permanent content in a large (fullscreen-like), medium-sized (halfscreen-like), or small area.</p>
</li><li><p id="p35545206423"><a name="p35545206423"></a><a name="p35545206423"></a><strong id="b11403369397"><a name="b11403369397"></a><a name="b11403369397"></a>temporary</strong>: A temporary panel displays content in a large (fullscreen-like) or medium-sized (halfscreen-like) area.</p>
</li></ul>
</td>
</tr>
<tr id="row1815511615424"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1755419206420"><a name="p1755419206420"></a><a name="p1755419206420"></a>mode</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p135544206422"><a name="p135544206422"></a><a name="p135544206422"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p13554192010427"><a name="p13554192010427"></a><a name="p13554192010427"></a>full</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p155418205426"><a name="p155418205426"></a><a name="p155418205426"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p655415206425"><a name="p655415206425"></a><a name="p655415206425"></a>Initial status of the slidable panel. Available values are as follows:</p>
<a name="ol6554220154216"></a><a name="ol6554220154216"></a><ol id="ol6554220154216"><li><p id="p12554520154216"><a name="p12554520154216"></a><a name="p12554520154216"></a><strong id="b13227603353"><a name="b13227603353"></a><a name="b13227603353"></a>mini</strong>: Displays a <strong id="b18230114212422"><a name="b18230114212422"></a><a name="b18230114212422"></a>minibar</strong> or <strong id="b3615459421"><a name="b3615459421"></a><a name="b3615459421"></a>foldable</strong> panel in its minimum size. This attribute does not take effect for <strong id="b65822124212"><a name="b65822124212"></a><a name="b65822124212"></a>temporary</strong> panels.</p>
</li><li><p id="p1955422014218"><a name="p1955422014218"></a><a name="p1955422014218"></a><strong id="b7388181616411"><a name="b7388181616411"></a><a name="b7388181616411"></a>half</strong>: Displays a <strong id="b14130550104216"><a name="b14130550104216"></a><a name="b14130550104216"></a>foldable</strong> or <strong id="b1347545294213"><a name="b1347545294213"></a><a name="b1347545294213"></a>temporary</strong> panel in a medium-sized (halfscreen-like) area. This attribute does not take effect for <strong id="b17461163424318"><a name="b17461163424318"></a><a name="b17461163424318"></a>minibar</strong> panels.</p>
</li><li><p id="p15541020134214"><a name="p15541020134214"></a><a name="p15541020134214"></a><strong id="b56264913506"><a name="b56264913506"></a><a name="b56264913506"></a>full</strong>: Displays a panel in a large (fullscreen-like) area.</p>
</li></ol>
</td>
</tr>
<tr id="row1213173154220"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p855432019421"><a name="p855432019421"></a><a name="p855432019421"></a>dragbar</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p155482015422"><a name="p155482015422"></a><a name="p155482015422"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p1955552064210"><a name="p1955552064210"></a><a name="p1955552064210"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p755542024213"><a name="p755542024213"></a><a name="p755542024213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p135551520114215"><a name="p135551520114215"></a><a name="p135551520114215"></a>Whether to enable a drag bar. The value <strong id="b899416435214"><a name="b899416435214"></a><a name="b899416435214"></a>true</strong> indicates that the drag bar will be displayed, and <strong id="b1834810239526"><a name="b1834810239526"></a><a name="b1834810239526"></a>false</strong> indicates the opposite.</p>
</td>
</tr>
<tr id="row827211578416"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p55550201428"><a name="p55550201428"></a><a name="p55550201428"></a>fullheight</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p2055572012425"><a name="p2055572012425"></a><a name="p2055572012425"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p145551220104214"><a name="p145551220104214"></a><a name="p145551220104214"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1555182013429"><a name="p1555182013429"></a><a name="p1555182013429"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p16555102011423"><a name="p16555102011423"></a><a name="p16555102011423"></a>Panel height in the <strong id="b190616511539"><a name="b190616511539"></a><a name="b190616511539"></a>full</strong> mode. The default value is the screen height minus 8 px.</p>
</td>
</tr>
<tr id="row9344751124116"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p10555162017420"><a name="p10555162017420"></a><a name="p10555162017420"></a>halfheight</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p1055572011422"><a name="p1055572011422"></a><a name="p1055572011422"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p19555192018423"><a name="p19555192018423"></a><a name="p19555192018423"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p5555720134214"><a name="p5555720134214"></a><a name="p5555720134214"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p17555320194211"><a name="p17555320194211"></a><a name="p17555320194211"></a>Panel height in the <strong id="b360733265415"><a name="b360733265415"></a><a name="b360733265415"></a>half</strong> mode. The default value is half of the screen height.</p>
</td>
</tr>
<tr id="row278634674117"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p18556132014422"><a name="p18556132014422"></a><a name="p18556132014422"></a>miniheight</p>
</td>
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p id="p5556920194212"><a name="p5556920194212"></a><a name="p5556920194212"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.43%" headers="mcps1.1.6.1.3 "><p id="p15561207425"><a name="p15561207425"></a><a name="p15561207425"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p55565208428"><a name="p55565208428"></a><a name="p55565208428"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p115561020164217"><a name="p115561020164217"></a><a name="p115561020164217"></a>Panel height in the <strong id="b634712315173"><a name="b634712315173"></a><a name="b634712315173"></a>mini</strong> mode. The default value is <strong id="b1170192112410"><a name="b1170192112410"></a><a name="b1170192112410"></a>48px</strong>.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:** ## Attributes
>- Rendering attributes, including **for**, **if**, and **show**, are not supported.
>- The **focusable** and **disabled** attributes are not supported.
## Styles<a name="section1137118175437"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
Only the following style attributes are supported. | Name | Type | Default Value | Mandatory | Description |
| ---------- | -------------- | -------- | ---- | ---------------------------------------- |
| type | string | foldable | Yes | Type of the slidable panel. This attribute cannot be dynamically changed. Available values are as follows:<br>- **minibar**: A minibar panel displays content in the minibar area or a large (fullscreen-like) area.<br>- **foldable**: A foldable panel displays permanent content in a large (fullscreen-like), medium-sized (halfscreen-like), or small area.<br>- **temporary**: A temporary panel displays content in a large (fullscreen-like) or medium-sized (halfscreen-like) area.|
| mode | string | full | No | Initial status of the slidable panel. Available values are as follows:<br>1. **mini**: Displays a **minibar** or **foldable** panel in its minimum size. This attribute does not take effect for **temporary** panels.<br>2. **half**: Displays a **foldable** or **temporary** panel in a medium-sized (halfscreen-like) area. This attribute does not take effect for **minibar** panels.<br>3. **full**: Displays a panel in a large (fullscreen-like) area.|
| dragbar | boolean | true | No | Whether to enable a drag bar. The value **true** means that the drag bar will be displayed, and **false** means the opposite. |
| fullheight | &lt;length&gt; | - | No | Panel height in the **full** mode. The default value is the screen height minus 8 px. |
| halfheight | &lt;length&gt; | - | No | Panel height in the **half** mode. The default value is half of the screen height. |
| miniheight | &lt;length&gt; | - | No | Panel height in the **mini** mode. The default value is **48px**. |
> **NOTE**
> - Rendering attributes, including **for**, **if**, and **show**, are not supported.
>
> - The **focusable** and **disabled** attributes are not supported.
## Styles
Only the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ---------------------------------------- | ---------------------------------------- | ------------ | ---- | ---------------------------------------- |
| padding | &lt;length&gt; | 0 | No | The attribute can have one to four values:<br>- If you set only one value, it specifies the padding for all the four sides.<br>- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.<br>- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.<br>- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).|
| padding-[left\|top\|right\|bottom] | &lt;length&gt; | 0 | No | Left, top, right, and bottom padding. |
| padding-[start\|end] | &lt;length&gt; | 0 | No | Start and end padding. |
| margin | &lt;length&gt; | 0 | No | Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values:<br>- If you set only one value, it specifies the margin for all the four sides.<br>- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.<br>- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.<br>- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).|
| margin-[left\|top\|right\|bottom] | &lt;length&gt; | 0 | No | Left, top, right, and bottom margins. |
| margin-[start\|end] | &lt;length&gt; | 0 | No | Start and end margins. |
| border | - | 0 | No | Shorthand attribute to set all borders. Set **border-width**, **border-style**, and **border-color** in sequence. Default values are used for attributes that are not set.|
| border-style | string | solid | No | Shorthand attribute to set the style for all borders. Available values are as follows:<br>- **dotted**: dotted border. The radius of a dot is half of **border-width**.<br>- **dashed**: dashed border.<br>- **solid**: solid border.|
| border-[left\|top\|right\|bottom]-style | string | solid | No | Styles of the left, top, right, and bottom borders. The available values are **dotted**, **dashed**, and **solid**.|
| border-[left\|top\|right\|bottom] | - | - | No | Shorthand attribute to set the borders for every side respectively. Set **border-width**, **border-style**, and **border-color** in sequence. Default values are used for attributes that are not set.|
| border-width | &lt;length&gt; | 0 | No | Shorthand attribute to set the width for all borders, or separately set the width for each border. |
| border-[left\|top\|right\|bottom]-width | &lt;length&gt; | 0 | No | Attribute to set widths of left, top, right, and bottom borders. |
| border-color | &lt;color&gt; | black | No | Shorthand attribute to set the color for all borders, or separately set the color for each border. |
| border-[left\|top\|right\|bottom]-color | &lt;color&gt; | black | No | Attribute to set colors for left, top, right, and bottom borders. |
| border-radius | &lt;length&gt; | - | No | Attribute to set the radius of round-corner borders. This attribute cannot be used to set the width or color of a specific border. To set the width or color, you must set **border-width** or **border-color** for all the borders at the same time. |
| border-[top\|bottom]-[left\|right]-radius | &lt;length&gt; | - | No | Attribute to respectively set the radii of upper-left, upper-right, lower-right, and lower-left rounded corners |
| background | &lt;linear-gradient&gt; | - | No | Background. This attribute supports [gradient styles](../arkui-js/js-components-common-gradient.md) only and is not compatible with **background-color** or **background-image**.|
| background-color | &lt;color&gt; | - | No | Background color. |
| background-image | string | - | No | Background image. This attribute is not compatible with **background-color** or **background**. Local image resources are supported. |
| background-size | - string<br>- &lt;length&gt; &lt;length&gt;<br>- &lt;percentage&gt; &lt;percentage&gt; | auto | No | Background image size.<br>- The **string** values are as follows:<br> - **contain**: Expands the image to the maximum size so that its height and width are fully applicable to the content area.<br> - **cover**: Extends the background image to a large enough size so that it completely covers the background area. Some parts of the image may not be displayed in the background area.<br> - **auto**: Retains the original aspect ratio of the image.<br>- The two **length** values are width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default.<br>- The two **percentage** values are width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default. |
| background-repeat | string | repeat | No | Repeating attribute of a background image. By default, a background image is repeated both horizontally and vertically.<br>- **repeat**: The image is repeated along the x-axis and y-axis at the same time.<br>- **repeat-x**: The image is repeated along the x-axis.<br>- **repeat-y**: The image is repeated along the y-axis.<br>- **no-repeat**: The image is not repeated.|
| background-position | - string string<br>- &lt;length&gt; &lt;length&gt;<br>- &lt;percentage&gt; &lt;percentage&gt; | 0px 0px | No | - Using keywords: If only one keyword is specified, the other value is **center** by default. The two values define the horizontal position and vertical position, respectively.<br> - **left**: leftmost in the horizontal direction.<br> - **right**: rightmost in the horizontal direction.<br> - **top**: top in the vertical direction.<br> - **bottom**: bottom in the vertical direction.<br> - **center**: center position.<br>- Using **length** values: The first value indicates the horizontal position, and the second value indicates the vertical position. For the upper left corner, the value is **0 0**. The unit is pixel. If only one value is specified, the other one is **50%**.<br>- Using **percentage** values: The first value indicates the horizontal position, and the second value indicates the vertical position. **0% 0%** indicates the upper left corner. **100% 100%** indicates the lower right corner. If only one value is specified, the other one is **50%**.<br>- Using both **percentage** and **length** values.|
| 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. |
<a name="table1744514388541"></a>
<table><thead align="left"><tr id="row1244614388545"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="a4e80fb5a797c4328af30d59e2c570c71"><a name="a4e80fb5a797c4328af30d59e2c570c71"></a><a name="a4e80fb5a797c4328af30d59e2c570c71"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="a4238bd3a376645a3ad8498d3916ed6c8"><a name="a4238bd3a376645a3ad8498d3916ed6c8"></a><a name="a4238bd3a376645a3ad8498d3916ed6c8"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="a5ece9efc3a1d464a868f9557e4784a97"><a name="a5ece9efc3a1d464a868f9557e4784a97"></a><a name="a5ece9efc3a1d464a868f9557e4784a97"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p117421754619"><a name="p117421754619"></a><a name="p117421754619"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="a2454f35c1eef44b4bb681caaa3ce48fc"><a name="a2454f35c1eef44b4bb681caaa3ce48fc"></a><a name="a2454f35c1eef44b4bb681caaa3ce48fc"></a>Triggered when</p>
</th>
</tr>
</thead>
<tbody><tr id="row18446638145412"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a541d1aa6d8ec43c28527ff9791c4cfc3"><a name="a541d1aa6d8ec43c28527ff9791c4cfc3"></a><a name="a541d1aa6d8ec43c28527ff9791c4cfc3"></a>padding</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a4d96fa6350a84c17ad53830df77db84e"><a name="a4d96fa6350a84c17ad53830df77db84e"></a><a name="a4d96fa6350a84c17ad53830df77db84e"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="aaa8cc18f5e03468cac00fb13b44abe01"><a name="aaa8cc18f5e03468cac00fb13b44abe01"></a><a name="aaa8cc18f5e03468cac00fb13b44abe01"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a268bdb972a1147b2b1fc6b930ca565e7"><a name="a268bdb972a1147b2b1fc6b930ca565e7"></a><a name="a268bdb972a1147b2b1fc6b930ca565e7"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><div class="p" id="a9d4f39d126ce4c4cb7652dc07238acf0"><a name="a9d4f39d126ce4c4cb7652dc07238acf0"></a><a name="a9d4f39d126ce4c4cb7652dc07238acf0"></a>The attribute can have one to four values:<a name="udb68dd5e787d4dc4ba26465e8450efe7"></a><a name="udb68dd5e787d4dc4ba26465e8450efe7"></a><ul id="udb68dd5e787d4dc4ba26465e8450efe7"><li><p id="a95f9b1440265405fa0007c00d337dab3"><a name="a95f9b1440265405fa0007c00d337dab3"></a><a name="a95f9b1440265405fa0007c00d337dab3"></a>If you set only one value, it specifies the padding for four sides.</p>
</li><li><p id="a1c1fdd035aee4b3a8a61fc1a42c967e4"><a name="a1c1fdd035aee4b3a8a61fc1a42c967e4"></a><a name="a1c1fdd035aee4b3a8a61fc1a42c967e4"></a>If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.</p>
</li><li><p id="a643af1b111eb4220a3703a37180c0735"><a name="a643af1b111eb4220a3703a37180c0735"></a><a name="a643af1b111eb4220a3703a37180c0735"></a>If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.</p>
</li><li><p id="ab8cfda39634d4ecf86eb772c1b654f7e"><a name="ab8cfda39634d4ecf86eb772c1b654f7e"></a><a name="ab8cfda39634d4ecf86eb772c1b654f7e"></a>If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).</p>
</li></ul>
</div>
</td>
</tr>
<tr id="row24464380544"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a2b2d344bb3214009a6866bd4766407d3"><a name="a2b2d344bb3214009a6866bd4766407d3"></a><a name="a2b2d344bb3214009a6866bd4766407d3"></a>padding-[left|top|right|bottom]</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="aa67316592ce34e00bcbfaa90f10d08cf"><a name="aa67316592ce34e00bcbfaa90f10d08cf"></a><a name="aa67316592ce34e00bcbfaa90f10d08cf"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a426b27187104497493502b4c45545091"><a name="a426b27187104497493502b4c45545091"></a><a name="a426b27187104497493502b4c45545091"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a2018ad09e4c94cdf84d402e11c1410d5"><a name="a2018ad09e4c94cdf84d402e11c1410d5"></a><a name="a2018ad09e4c94cdf84d402e11c1410d5"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="ae34337bc334e4e15843bf03563f8572a"><a name="ae34337bc334e4e15843bf03563f8572a"></a><a name="ae34337bc334e4e15843bf03563f8572a"></a>Left, top, right, and bottom padding.</p>
</td>
</tr>
<tr id="row1144723845412"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="aaff96272d36945239259ab5e76ec433e"><a name="aaff96272d36945239259ab5e76ec433e"></a><a name="aaff96272d36945239259ab5e76ec433e"></a>padding-[start|end]</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a2dedafe206c84605a2686c505cbd2096"><a name="a2dedafe206c84605a2686c505cbd2096"></a><a name="a2dedafe206c84605a2686c505cbd2096"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a27db5e428204402aa54deaa2c2630eac"><a name="a27db5e428204402aa54deaa2c2630eac"></a><a name="a27db5e428204402aa54deaa2c2630eac"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a2952814e86f14ec6a133e606c78683d8"><a name="a2952814e86f14ec6a133e606c78683d8"></a><a name="a2952814e86f14ec6a133e606c78683d8"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="aaf71a7aed79445c18bb63ae5f5a00314"><a name="aaf71a7aed79445c18bb63ae5f5a00314"></a><a name="aaf71a7aed79445c18bb63ae5f5a00314"></a>Start and end padding.</p>
</td>
</tr>
<tr id="row11447438175410"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="ae3cc1b4f8cc94962aeaf8f3b52b4e9f0"><a name="ae3cc1b4f8cc94962aeaf8f3b52b4e9f0"></a><a name="ae3cc1b4f8cc94962aeaf8f3b52b4e9f0"></a>margin</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a81d0391edfc04d1395d61d8053fa93d6"><a name="a81d0391edfc04d1395d61d8053fa93d6"></a><a name="a81d0391edfc04d1395d61d8053fa93d6"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a9c42aa4dad8c4f58a9f85a3e2b4d1e15"><a name="a9c42aa4dad8c4f58a9f85a3e2b4d1e15"></a><a name="a9c42aa4dad8c4f58a9f85a3e2b4d1e15"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a9be9fbee32844dea910afca9a2221bac"><a name="a9be9fbee32844dea910afca9a2221bac"></a><a name="a9be9fbee32844dea910afca9a2221bac"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="afe56536fd53c409db2033b4be7135555"><a name="afe56536fd53c409db2033b4be7135555"></a><a name="afe56536fd53c409db2033b4be7135555"></a>Shorthand attribute to set margins for all sides in a declaration. The attribute can have one to four values:</p>
<a name="u1fe7f0fee6294e3aabd5a16f16f62eaa"></a><a name="u1fe7f0fee6294e3aabd5a16f16f62eaa"></a><ul id="u1fe7f0fee6294e3aabd5a16f16f62eaa"><li><p id="a51f7d66473934ec6918040a4da7ed533"><a name="a51f7d66473934ec6918040a4da7ed533"></a><a name="a51f7d66473934ec6918040a4da7ed533"></a>If you set only one value, it specifies the margin for all the four sides.</p>
</li><li><p id="a446e0dc7bfbc4aa580ede47e4af3901c"><a name="a446e0dc7bfbc4aa580ede47e4af3901c"></a><a name="a446e0dc7bfbc4aa580ede47e4af3901c"></a>If you set two values, the first value is for the top and bottom sides and the second value for the left and right sides.</p>
</li><li><p id="a2ce71640e6964e86acb7f6abd6e6aec8"><a name="a2ce71640e6964e86acb7f6abd6e6aec8"></a><a name="a2ce71640e6964e86acb7f6abd6e6aec8"></a>If you set three values, the first value is for the top, the second value for the left and right, and the third value for the bottom.</p>
</li><li><p id="a86622e9fbdeb409cb5afcc0b2c7fe651"><a name="a86622e9fbdeb409cb5afcc0b2c7fe651"></a><a name="a86622e9fbdeb409cb5afcc0b2c7fe651"></a>If you set four values, they are margins for top, right, bottom, and left sides, respectively.</p>
</li></ul>
</td>
</tr>
<tr id="row144473383544"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="af348632f1a9045e2a46377d98e6a823f"><a name="af348632f1a9045e2a46377d98e6a823f"></a><a name="af348632f1a9045e2a46377d98e6a823f"></a>margin-[left|top|right|bottom]</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="aa2920472d95e4c59b3caa0c64dbf028b"><a name="aa2920472d95e4c59b3caa0c64dbf028b"></a><a name="aa2920472d95e4c59b3caa0c64dbf028b"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a1086205d47a84dbcb8b537076d758d6f"><a name="a1086205d47a84dbcb8b537076d758d6f"></a><a name="a1086205d47a84dbcb8b537076d758d6f"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a644285f82f7a4953b96b710055360358"><a name="a644285f82f7a4953b96b710055360358"></a><a name="a644285f82f7a4953b96b710055360358"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a14777b85d0f7480b9e707f2986db519f"><a name="a14777b85d0f7480b9e707f2986db519f"></a><a name="a14777b85d0f7480b9e707f2986db519f"></a>Left, top, right, and bottom margins.</p>
</td>
</tr>
<tr id="row944743811541"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a2f323eb272624b5191876de68ebfd133"><a name="a2f323eb272624b5191876de68ebfd133"></a><a name="a2f323eb272624b5191876de68ebfd133"></a>margin-[start|end]</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="en-us_topic_0000001050791158_p157617124374"><a name="en-us_topic_0000001050791158_p157617124374"></a><a name="en-us_topic_0000001050791158_p157617124374"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a3874f54c277642e198919edbafa4216b"><a name="a3874f54c277642e198919edbafa4216b"></a><a name="a3874f54c277642e198919edbafa4216b"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p117511744618"><a name="p117511744618"></a><a name="p117511744618"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="ae427df4a00bf46379ce337974a1d17df"><a name="ae427df4a00bf46379ce337974a1d17df"></a><a name="ae427df4a00bf46379ce337974a1d17df"></a>Start and end margins.</p>
</td>
</tr>
<tr id="row16447238155411"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a5d03dcff88b94f7b894d65fdf08d1434"><a name="a5d03dcff88b94f7b894d65fdf08d1434"></a><a name="a5d03dcff88b94f7b894d65fdf08d1434"></a>border</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a5ebca7bf3c34482eae9b3148bb3394de"><a name="a5ebca7bf3c34482eae9b3148bb3394de"></a><a name="a5ebca7bf3c34482eae9b3148bb3394de"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a4bff92bcfc064eaf8ae31845ab40f95d"><a name="a4bff92bcfc064eaf8ae31845ab40f95d"></a><a name="a4bff92bcfc064eaf8ae31845ab40f95d"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p11175131715467"><a name="p11175131715467"></a><a name="p11175131715467"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a18290265c858402dad42d13f5df9556f"><a name="a18290265c858402dad42d13f5df9556f"></a><a name="a18290265c858402dad42d13f5df9556f"></a>Shorthand attribute to set all borders. Set <strong id="b083513429473"><a name="b083513429473"></a><a name="b083513429473"></a>border-width</strong>, <strong id="b984410426477"><a name="b984410426477"></a><a name="b984410426477"></a>border-style</strong>, and <strong id="b13845154204714"><a name="b13845154204714"></a><a name="b13845154204714"></a>border-color</strong> in sequence. Default values are used for attributes that are not set.</p>
</td>
</tr>
<tr id="row4447138115414"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a3247ae43aa8443f184f52e45ccd0ca07"><a name="a3247ae43aa8443f184f52e45ccd0ca07"></a><a name="a3247ae43aa8443f184f52e45ccd0ca07"></a>border-style</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a3da2ed807521431e987b22e624574dc0"><a name="a3da2ed807521431e987b22e624574dc0"></a><a name="a3da2ed807521431e987b22e624574dc0"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a0187620d3c154706944fc4c01734d48f"><a name="a0187620d3c154706944fc4c01734d48f"></a><a name="a0187620d3c154706944fc4c01734d48f"></a>solid</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p617531717464"><a name="p617531717464"></a><a name="p617531717464"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a29372dc23f5f4307929d789f9b76472e"><a name="a29372dc23f5f4307929d789f9b76472e"></a><a name="a29372dc23f5f4307929d789f9b76472e"></a>Shorthand attribute to set the style for all borders. Available values are as follows:</p>
<a name="u5617b1dfdf2048739b8699b11a69d8db"></a><a name="u5617b1dfdf2048739b8699b11a69d8db"></a><ul id="u5617b1dfdf2048739b8699b11a69d8db"><li><strong id="b152932468478"><a name="b152932468478"></a><a name="b152932468478"></a>dotted</strong>: dotted border. The radius of a dot is half of <strong id="b1294184614715"><a name="b1294184614715"></a><a name="b1294184614715"></a>border-width</strong>.</li><li><strong id="b063849104711"><a name="b063849104711"></a><a name="b063849104711"></a>dashed</strong>: dashed border</li></ul>
<a name="u9d6301312eda4022a25e3774fc603823"></a><a name="u9d6301312eda4022a25e3774fc603823"></a><ul id="u9d6301312eda4022a25e3774fc603823"><li><strong id="b770165294712"><a name="b770165294712"></a><a name="b770165294712"></a>solid</strong>: solid border</li></ul>
</td>
</tr>
<tr id="row1656512239262"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a3264ee35efcd40aeb8ed5931bf62f9e3"><a name="a3264ee35efcd40aeb8ed5931bf62f9e3"></a><a name="a3264ee35efcd40aeb8ed5931bf62f9e3"></a>border-[left|top|right|bottom]-style</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="af7370e9f2bd3451bba0b2b0a865b8f43"><a name="af7370e9f2bd3451bba0b2b0a865b8f43"></a><a name="af7370e9f2bd3451bba0b2b0a865b8f43"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a682f8be227ba4adfa13eac52c1c513b9"><a name="a682f8be227ba4adfa13eac52c1c513b9"></a><a name="a682f8be227ba4adfa13eac52c1c513b9"></a>solid</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a2edc177990bb4674bea5fc0c2cadf1df"><a name="a2edc177990bb4674bea5fc0c2cadf1df"></a><a name="a2edc177990bb4674bea5fc0c2cadf1df"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="abfe3dfb0662b4a6c850a8d5d285dff6d"><a name="abfe3dfb0662b4a6c850a8d5d285dff6d"></a><a name="abfe3dfb0662b4a6c850a8d5d285dff6d"></a>Styles of the left, top, right, and bottom borders. The available values are <strong id="b5137105454712"><a name="b5137105454712"></a><a name="b5137105454712"></a>dotted</strong>, <strong id="b111381654144718"><a name="b111381654144718"></a><a name="b111381654144718"></a>dashed</strong>, and <strong id="b101391554184712"><a name="b101391554184712"></a><a name="b101391554184712"></a>solid</strong>.</p>
</td>
</tr>
<tr id="row19448113811542"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="aca24a970df9c42d3bdd871a44ad17f2f"><a name="aca24a970df9c42d3bdd871a44ad17f2f"></a><a name="aca24a970df9c42d3bdd871a44ad17f2f"></a>border-[left|top|right|bottom]</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="af20792fd5492451096250fc7db910669"><a name="af20792fd5492451096250fc7db910669"></a><a name="af20792fd5492451096250fc7db910669"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="aa13a80ae5fad42289bae4fb76dc9efeb"><a name="aa13a80ae5fad42289bae4fb76dc9efeb"></a><a name="aa13a80ae5fad42289bae4fb76dc9efeb"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a45d917a58f9e45f79c931a9ede2f7521"><a name="a45d917a58f9e45f79c931a9ede2f7521"></a><a name="a45d917a58f9e45f79c931a9ede2f7521"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a5ec1cb3c8733406b91ad459e012f91f4"><a name="a5ec1cb3c8733406b91ad459e012f91f4"></a><a name="a5ec1cb3c8733406b91ad459e012f91f4"></a>Shorthand attribute to set the borders for every side respectively. You set <strong id="b11961957114716"><a name="b11961957114716"></a><a name="b11961957114716"></a>border-width</strong>, <strong id="b7103145715476"><a name="b7103145715476"></a><a name="b7103145715476"></a>border-style</strong>, and <strong id="b16104175711473"><a name="b16104175711473"></a><a name="b16104175711473"></a>border-color</strong> in sequence. Default values are used for attributes that are not set.</p>
</td>
</tr>
<tr id="row124481638165417"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a5e2a85c8033f42d7b69cf67e5468e805"><a name="a5e2a85c8033f42d7b69cf67e5468e805"></a><a name="a5e2a85c8033f42d7b69cf67e5468e805"></a>border-width</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a68368a57007c44faa8d926acac48f0df"><a name="a68368a57007c44faa8d926acac48f0df"></a><a name="a68368a57007c44faa8d926acac48f0df"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a21a68501e60245b9beba967ead6cb1f9"><a name="a21a68501e60245b9beba967ead6cb1f9"></a><a name="a21a68501e60245b9beba967ead6cb1f9"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p16175131724618"><a name="p16175131724618"></a><a name="p16175131724618"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="aad1af0ece034401a8c56fb287c16320c"><a name="aad1af0ece034401a8c56fb287c16320c"></a><a name="aad1af0ece034401a8c56fb287c16320c"></a>Shorthand attribute to set the width of all borders<span id="ph1439331144812"><a name="ph1439331144812"></a><a name="ph1439331144812"></a>, or separately set the width of each border</span>.</p>
</td>
</tr>
<tr id="row54481038165410"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="af71ca4e515d0470ea0867f157c125ffb"><a name="af71ca4e515d0470ea0867f157c125ffb"></a><a name="af71ca4e515d0470ea0867f157c125ffb"></a>border-[left|top|right|bottom]-width</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a5d713a4524c94d88bb768770c4b9871b"><a name="a5d713a4524c94d88bb768770c4b9871b"></a><a name="a5d713a4524c94d88bb768770c4b9871b"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a598e0a5a87cc4e1aad99441d0899c064"><a name="a598e0a5a87cc4e1aad99441d0899c064"></a><a name="a598e0a5a87cc4e1aad99441d0899c064"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p11175151717466"><a name="p11175151717466"></a><a name="p11175151717466"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a0e87cf1edd0f474cb33591ce68b19296"><a name="a0e87cf1edd0f474cb33591ce68b19296"></a><a name="a0e87cf1edd0f474cb33591ce68b19296"></a>Attribute to set widths of left, top, right, and bottom borders.</p>
</td>
</tr>
<tr id="row1744817385547"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a971adbece55a4864ad6a089be7eb12d2"><a name="a971adbece55a4864ad6a089be7eb12d2"></a><a name="a971adbece55a4864ad6a089be7eb12d2"></a>border-color</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a2676a7ea563844569103471ed3d2bcb6"><a name="a2676a7ea563844569103471ed3d2bcb6"></a><a name="a2676a7ea563844569103471ed3d2bcb6"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a6a41565e7f71412b91e94f6ba95b8a84"><a name="a6a41565e7f71412b91e94f6ba95b8a84"></a><a name="a6a41565e7f71412b91e94f6ba95b8a84"></a>black</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1017518177465"><a name="p1017518177465"></a><a name="p1017518177465"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a5c2063b884d84196b3a328d8029c5bbd"><a name="a5c2063b884d84196b3a328d8029c5bbd"></a><a name="a5c2063b884d84196b3a328d8029c5bbd"></a>Shorthand attribute to set the color of all borders<span id="ph20728201214910"><a name="ph20728201214910"></a><a name="ph20728201214910"></a>, or separately set the color of each border</span>.</p>
</td>
</tr>
<tr id="row844813835410"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a7385c35d96a84cb9945ba0afe8f39f27"><a name="a7385c35d96a84cb9945ba0afe8f39f27"></a><a name="a7385c35d96a84cb9945ba0afe8f39f27"></a>border-[left|top|right|bottom]-color</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="adc421d4d9fe242968ccae293e5a1d8ca"><a name="adc421d4d9fe242968ccae293e5a1d8ca"></a><a name="adc421d4d9fe242968ccae293e5a1d8ca"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a997049720b89455581e5ae2ea47c5f76"><a name="a997049720b89455581e5ae2ea47c5f76"></a><a name="a997049720b89455581e5ae2ea47c5f76"></a>black</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p11175417184611"><a name="p11175417184611"></a><a name="p11175417184611"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a3a75202614f54b8d86865e6bdd23220e"><a name="a3a75202614f54b8d86865e6bdd23220e"></a><a name="a3a75202614f54b8d86865e6bdd23220e"></a>Attribute to set colors of left, top, right, and bottom borders.</p>
</td>
</tr>
<tr id="row944813389540"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="aeb41e1dcf38048a7a870b7fbc262d9b3"><a name="aeb41e1dcf38048a7a870b7fbc262d9b3"></a><a name="aeb41e1dcf38048a7a870b7fbc262d9b3"></a>border-radius</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a1b2aa369911d430892c9c2ccc8c92eee"><a name="a1b2aa369911d430892c9c2ccc8c92eee"></a><a name="a1b2aa369911d430892c9c2ccc8c92eee"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="afebc1d7def134a30b454052ffd82fcd5"><a name="afebc1d7def134a30b454052ffd82fcd5"></a><a name="afebc1d7def134a30b454052ffd82fcd5"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a7477a88e90164a46ba6b4dd7b6b39909"><a name="a7477a88e90164a46ba6b4dd7b6b39909"></a><a name="a7477a88e90164a46ba6b4dd7b6b39909"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a3df8b3f3ec00490a9687f38cb6369c75"><a name="a3df8b3f3ec00490a9687f38cb6369c75"></a><a name="a3df8b3f3ec00490a9687f38cb6369c75"></a>Attribute to set the radius of round-corner borders. <span id="ph8921172719494"><a name="ph8921172719494"></a><a name="ph8921172719494"></a>This attribute cannot be used to set the width or color of a specific border. To set the width or color, you need to set <strong id="b1891342784915"><a name="b1891342784915"></a><a name="b1891342784915"></a>border-width</strong> or <strong id="b159203275495"><a name="b159203275495"></a><a name="b159203275495"></a>border-color</strong> for all the borders at the same time.</span></p>
</td>
</tr>
<tr id="row104494382546"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a7f4cc47cb21f4241bc50c09595abe42b"><a name="a7f4cc47cb21f4241bc50c09595abe42b"></a><a name="a7f4cc47cb21f4241bc50c09595abe42b"></a>border-[top|bottom]-[left|right]-radius</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="af4577f8f400e44dd92306d77f0b600c7"><a name="af4577f8f400e44dd92306d77f0b600c7"></a><a name="af4577f8f400e44dd92306d77f0b600c7"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="adba608505d644afcb117ae14679054cf"><a name="adba608505d644afcb117ae14679054cf"></a><a name="adba608505d644afcb117ae14679054cf"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="af792dccde58c4e699a2a0b924d6111de"><a name="af792dccde58c4e699a2a0b924d6111de"></a><a name="af792dccde58c4e699a2a0b924d6111de"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a41f1597c4e454492aaea4818c234d429"><a name="a41f1597c4e454492aaea4818c234d429"></a><a name="a41f1597c4e454492aaea4818c234d429"></a>Attribute to receptively set the radii of upper-left, upper-right, lower-right, and lower-left rounded corners</p>
</td>
</tr>
<tr id="row1344912384548"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a473248d0f1ad4a6b87934aab462b09ce"><a name="a473248d0f1ad4a6b87934aab462b09ce"></a><a name="a473248d0f1ad4a6b87934aab462b09ce"></a>background</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a7c54e775a6bf4bbea277ff8927cc4c13"><a name="a7c54e775a6bf4bbea277ff8927cc4c13"></a><a name="a7c54e775a6bf4bbea277ff8927cc4c13"></a>&lt;linear-gradient&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a5bbca83860ff4086bba1bf5b8698e28c"><a name="a5bbca83860ff4086bba1bf5b8698e28c"></a><a name="a5bbca83860ff4086bba1bf5b8698e28c"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a047e39fe359445759a1ce07ca6d46a38"><a name="a047e39fe359445759a1ce07ca6d46a38"></a><a name="a047e39fe359445759a1ce07ca6d46a38"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a2681658e98234c0bb3dfb1a8fc1ae346"><a name="a2681658e98234c0bb3dfb1a8fc1ae346"></a><a name="a2681658e98234c0bb3dfb1a8fc1ae346"></a>This attribute supports <a href="js-components-common-gradient.md">Gradient Styles</a> only but is not compatible with <strong id="b199011833144912"><a name="b199011833144912"></a><a name="b199011833144912"></a>background-color</strong> or <strong id="b1690283344915"><a name="b1690283344915"></a><a name="b1690283344915"></a>background-image</strong>.</p>
</td>
</tr>
<tr id="row15449838185416"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="af5c7b4fc3d8949b5aff81c5b49783259"><a name="af5c7b4fc3d8949b5aff81c5b49783259"></a><a name="af5c7b4fc3d8949b5aff81c5b49783259"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a3f45d99020c04479943ad07f262a591c"><a name="a3f45d99020c04479943ad07f262a591c"></a><a name="a3f45d99020c04479943ad07f262a591c"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="add693215147d46e59c859940cc4520e8"><a name="add693215147d46e59c859940cc4520e8"></a><a name="add693215147d46e59c859940cc4520e8"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a5bd974fe26aa45409ff08d6d652b03e6"><a name="a5bd974fe26aa45409ff08d6d652b03e6"></a><a name="a5bd974fe26aa45409ff08d6d652b03e6"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="acd48c077d9964749ae766636b8ada95c"><a name="acd48c077d9964749ae766636b8ada95c"></a><a name="acd48c077d9964749ae766636b8ada95c"></a>Background color.</p>
</td>
</tr>
<tr id="row54491338115412"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a9ebf9bd289374413a2834bab0e3b46d4"><a name="a9ebf9bd289374413a2834bab0e3b46d4"></a><a name="a9ebf9bd289374413a2834bab0e3b46d4"></a>background-image</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a46c151a9e45b4ffcb4c45dfcb93214bd"><a name="a46c151a9e45b4ffcb4c45dfcb93214bd"></a><a name="a46c151a9e45b4ffcb4c45dfcb93214bd"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a8be7284eb5884350ba591183a67d4060"><a name="a8be7284eb5884350ba591183a67d4060"></a><a name="a8be7284eb5884350ba591183a67d4060"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a9ca4df413139442e8a520bc7c04dae02"><a name="a9ca4df413139442e8a520bc7c04dae02"></a><a name="a9ca4df413139442e8a520bc7c04dae02"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="aa236de4e56e349ff8c753d294e98abab"><a name="aa236de4e56e349ff8c753d294e98abab"></a><a name="aa236de4e56e349ff8c753d294e98abab"></a>Background image. Currently, this attribute is not compatible with <strong id="b168581843184914"><a name="b168581843184914"></a><a name="b168581843184914"></a>background-color</strong> or <strong id="b4866144318494"><a name="b4866144318494"></a><a name="b4866144318494"></a>background</strong>. Local image resources are supported.</p>
</td>
</tr>
<tr id="row6449238185416"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a5def9eea1a2b42e9b040f0f898a2fcdf"><a name="a5def9eea1a2b42e9b040f0f898a2fcdf"></a><a name="a5def9eea1a2b42e9b040f0f898a2fcdf"></a>background-size</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><a name="uc9d67b59ab8c4f5d8f766deb0f8f657b"></a><a name="uc9d67b59ab8c4f5d8f766deb0f8f657b"></a><ul id="uc9d67b59ab8c4f5d8f766deb0f8f657b"><li>string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a2d537661fce74b13acbcc7a95ea56f08"><a name="a2d537661fce74b13acbcc7a95ea56f08"></a><a name="a2d537661fce74b13acbcc7a95ea56f08"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="aa5ecaa85d6924436bb54a637b9d46c8c"><a name="aa5ecaa85d6924436bb54a637b9d46c8c"></a><a name="aa5ecaa85d6924436bb54a637b9d46c8c"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a0709b83d5c8e4b75b1f0bb42d913ac02"><a name="a0709b83d5c8e4b75b1f0bb42d913ac02"></a><a name="a0709b83d5c8e4b75b1f0bb42d913ac02"></a>Background image size.</p>
<a name="ub2423a2f8d96432f8c58c629288432c5"></a><a name="ub2423a2f8d96432f8c58c629288432c5"></a><ul id="ub2423a2f8d96432f8c58c629288432c5"><li>The <strong id="b13127185124910"><a name="b13127185124910"></a><a name="b13127185124910"></a>string</strong> values are as follows:<a name="uee8f5c89381a4ce682a5d557f8e558ee"></a><a name="uee8f5c89381a4ce682a5d557f8e558ee"></a><ul id="uee8f5c89381a4ce682a5d557f8e558ee"><li><strong id="b1474287165014"><a name="b1474287165014"></a><a name="b1474287165014"></a>contain</strong>: Expands the image to the maximum size so that the height and width of the image are applicable to the content area.</li><li><strong id="b311264385312"><a name="b311264385312"></a><a name="b311264385312"></a>cover</strong>: Extends the background image to a large enough size so that the background image completely covers the background area. Some parts of the image may not be displayed in the background area.</li><li><strong id="b163611704548"><a name="b163611704548"></a><a name="b163611704548"></a>auto</strong>: The original image width-height ratio is retained.</li></ul>
</li><li>The two <strong id="b64592211545"><a name="b64592211545"></a><a name="b64592211545"></a>&lt;length&gt;</strong> values are as follows:<p id="a5b969a49f8074aae96a12e4232e47c5d"><a name="a5b969a49f8074aae96a12e4232e47c5d"></a><a name="a5b969a49f8074aae96a12e4232e47c5d"></a>Width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to <strong id="b3412192712546"><a name="b3412192712546"></a><a name="b3412192712546"></a>auto</strong> by default.</p>
</li><li>The two <strong id="b344718292549"><a name="b344718292549"></a><a name="b344718292549"></a>&lt;percentage&gt;</strong> values are as follows:<p id="a19ef0a7986ce47f2b7fe614975e23cd9"><a name="a19ef0a7986ce47f2b7fe614975e23cd9"></a><a name="a19ef0a7986ce47f2b7fe614975e23cd9"></a>Width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to <strong id="b11170184116543"><a name="b11170184116543"></a><a name="b11170184116543"></a>auto</strong> by default.</p>
</li></ul>
</td>
</tr>
<tr id="row94491238155415"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a8e820e26428c4e008a691a8fc8c23294"><a name="a8e820e26428c4e008a691a8fc8c23294"></a><a name="a8e820e26428c4e008a691a8fc8c23294"></a>background-repeat</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="ab9ca7eb1f0fc48a9a3fc08b88fe11338"><a name="ab9ca7eb1f0fc48a9a3fc08b88fe11338"></a><a name="ab9ca7eb1f0fc48a9a3fc08b88fe11338"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="abbb032e6786d43568f7eea7b29611821"><a name="abbb032e6786d43568f7eea7b29611821"></a><a name="abbb032e6786d43568f7eea7b29611821"></a>repeat</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a53d72f211cdc44b181973e27c6f03845"><a name="a53d72f211cdc44b181973e27c6f03845"></a><a name="a53d72f211cdc44b181973e27c6f03845"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a64efc26d6e2c48a3a4032c71b8511085"><a name="a64efc26d6e2c48a3a4032c71b8511085"></a><a name="a64efc26d6e2c48a3a4032c71b8511085"></a>Repeating attribute of a background image. By default, a background image is repeated both horizontally and vertically.</p>
<a name="uee59e640d2304d56a0a5b396795a8cc5"></a><a name="uee59e640d2304d56a0a5b396795a8cc5"></a><ul id="uee59e640d2304d56a0a5b396795a8cc5"><li><strong id="b1953611845513"><a name="b1953611845513"></a><a name="b1953611845513"></a>repeat</strong>: Repeatedly draws images along the x-axis and y-axis at the same time.</li><li><strong id="b4728182018554"><a name="b4728182018554"></a><a name="b4728182018554"></a>repeat-x</strong>: Repeatedly draws images along the x-axis.</li><li><strong id="b38969231556"><a name="b38969231556"></a><a name="b38969231556"></a>repeat-y</strong>: Repeatedly draws images along the y-axis.</li><li><strong id="b106442517553"><a name="b106442517553"></a><a name="b106442517553"></a>no-repeat</strong>: The image is not drawn repeatedly.</li></ul>
</td>
</tr>
<tr id="row94491738105419"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a60e011e34e6c4b04a1c86ac873087eed"><a name="a60e011e34e6c4b04a1c86ac873087eed"></a><a name="a60e011e34e6c4b04a1c86ac873087eed"></a>background-position</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><a name="u2fe0f6beda39428780ca525d6dca1b30"></a><a name="u2fe0f6beda39428780ca525d6dca1b30"></a><ul id="u2fe0f6beda39428780ca525d6dca1b30"><li>string string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="ad96af7b5874e476db4b4cf968156a633"><a name="ad96af7b5874e476db4b4cf968156a633"></a><a name="ad96af7b5874e476db4b4cf968156a633"></a>0px 0px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="a735a713fbf2c4d2c9be71a5eb26e5371"><a name="a735a713fbf2c4d2c9be71a5eb26e5371"></a><a name="a735a713fbf2c4d2c9be71a5eb26e5371"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><a name="ub1e24d41a33d4560a6637f7a16ee5140"></a><a name="ub1e24d41a33d4560a6637f7a16ee5140"></a><ul id="ub1e24d41a33d4560a6637f7a16ee5140"><li>Using keywords: If only one keyword is specified, the other value is <strong id="b1375628105514"><a name="b1375628105514"></a><a name="b1375628105514"></a>center</strong> by default. The two values define the horizontal position and vertical position, respectively.<a name="uac6e07c1eb0244d79eeed180658cb6c6"></a><a name="uac6e07c1eb0244d79eeed180658cb6c6"></a><ul id="uac6e07c1eb0244d79eeed180658cb6c6"><li><strong id="b1895315557"><a name="b1895315557"></a><a name="b1895315557"></a>left</strong>: leftmost in the horizontal direction</li><li><strong id="b832423245517"><a name="b832423245517"></a><a name="b832423245517"></a>right</strong>: rightmost in the horizontal direction</li><li><strong id="b1252973310555"><a name="b1252973310555"></a><a name="b1252973310555"></a>top</strong>: top in the vertical direction</li><li><strong id="b157931134185511"><a name="b157931134185511"></a><a name="b157931134185511"></a>bottom</strong>: bottom in the vertical direction</li><li><strong id="b792773565515"><a name="b792773565515"></a><a name="b792773565515"></a>center</strong>: center position</li></ul>
</li></ul>
<a name="ua495746d9777430c973a5ec607309ac4"></a><a name="ua495746d9777430c973a5ec607309ac4"></a><ul id="ua495746d9777430c973a5ec607309ac4"><li>Using <strong id="b15235143718553"><a name="b15235143718553"></a><a name="b15235143718553"></a>&lt;length&gt;</strong>: The first value indicates the horizontal position, and the second value indicates the vertical position. <strong id="b10672040165512"><a name="b10672040165512"></a><a name="b10672040165512"></a>0 0</strong> indicates the upper left corner. The unit is pixel. If only one value is specified, the other one is <strong id="b182882471554"><a name="b182882471554"></a><a name="b182882471554"></a>50%</strong>.</li><li>Using <strong id="b4812144875514"><a name="b4812144875514"></a><a name="b4812144875514"></a>&lt;percentage&gt;</strong>: The first value indicates the horizontal position, and the second value indicates the vertical position. <strong id="b20541964578"><a name="b20541964578"></a><a name="b20541964578"></a>0% 0%</strong> indicates the upper left corner. <strong id="b561913815576"><a name="b561913815576"></a><a name="b561913815576"></a>100% 100%</strong> indicates the lower right corner. If only one value is specified, the other one is <strong id="b88734955715"><a name="b88734955715"></a><a name="b88734955715"></a>50%</strong>.</li><li>Using both <strong id="b6916141065718"><a name="b6916141065718"></a><a name="b6916141065718"></a>&lt;percentage&gt;</strong> and <strong id="b5917121019577"><a name="b5917121019577"></a><a name="b5917121019577"></a>&lt;length&gt;</strong>.</li></ul>
</td>
</tr>
<tr id="row20450143885416"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="a529a69841d634cdfa9637284412e5cf1"><a name="a529a69841d634cdfa9637284412e5cf1"></a><a name="a529a69841d634cdfa9637284412e5cf1"></a>opacity</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="a0820f7d1c5b34d6eab999bd9dddfad6c"><a name="a0820f7d1c5b34d6eab999bd9dddfad6c"></a><a name="a0820f7d1c5b34d6eab999bd9dddfad6c"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="a35dd1b1eab3a421f9c95d512860d5bda"><a name="a35dd1b1eab3a421f9c95d512860d5bda"></a><a name="a35dd1b1eab3a421f9c95d512860d5bda"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="ad2fe0856816f4eaf9c10e2a1d74419a9"><a name="ad2fe0856816f4eaf9c10e2a1d74419a9"></a><a name="ad2fe0856816f4eaf9c10e2a1d74419a9"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="a2e8d180f3c914356af72e679446f4ab5"><a name="a2e8d180f3c914356af72e679446f4ab5"></a><a name="a2e8d180f3c914356af72e679446f4ab5"></a>Opacity of an element. The value ranges from <strong id="b15364171275710"><a name="b15364171275710"></a><a name="b15364171275710"></a>0</strong> to <strong id="b93641412135719"><a name="b93641412135719"></a><a name="b93641412135719"></a>1</strong>. The value <strong id="b03651712145710"><a name="b03651712145710"></a><a name="b03651712145710"></a>1</strong> means opaque, and <strong id="b17366101211577"><a name="b17366101211577"></a><a name="b17366101211577"></a>0</strong> means completely transparent.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1614413538447"></a> ## Events
The following events are supported. The following events are supported.
<a name="table836435619510"></a> | Name | Parameter | Description |
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a0ff86a4560fa46bfbeb711d109869422"><a name="a0ff86a4560fa46bfbeb711d109869422"></a><a name="a0ff86a4560fa46bfbeb711d109869422"></a>Name</p> | ---------- | ---------------------------------------- | ---------------------------------------- |
</th> | sizechange | { size: { height: heightLength, width: widthLength }, mode: modeStr } | Triggered when the status of the slidable panel changes. Available **mode** values are as follows:<br>- **mini**: Displays a **minibar** or **foldable** panel in its minimum size.<br>- **half**: Displays a **foldable** panel in a medium-sized (halfscreen-like) area.<br>- **full**: Displays a panel in a large (fullscreen-like) area.<br>The returned **height** value indicates the content area height. However, when the **dragbar** attribute is **true**, the **height** value is the height of the drag bar plus that of the content area.|
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a4c85eb8ca18b4169a25c4a9263fa63ed"><a name="a4c85eb8ca18b4169a25c4a9263fa63ed"></a><a name="a4c85eb8ca18b4169a25c4a9263fa63ed"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="ab30b2353efa245fbad4d2aaa2ee33def"><a name="ab30b2353efa245fbad4d2aaa2ee33def"></a><a name="ab30b2353efa245fbad4d2aaa2ee33def"></a>Triggered when</p>
</th>
</tr>
</thead>
<tbody><tr id="row0576209174715"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p1652031354715"><a name="p1652031354715"></a><a name="p1652031354715"></a>sizechange</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p2520913204711"><a name="p2520913204711"></a><a name="p2520913204711"></a>{ size: { height: heightLength, width: widthLength }, mode: modeStr }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p8520101364714"><a name="p8520101364714"></a><a name="p8520101364714"></a>Triggered when the status of the slidable panel changes. Available <strong id="b122905111282"><a name="b122905111282"></a><a name="b122905111282"></a>mode</strong> values are as follows:</p>
<a name="ol5520181316476"></a><a name="ol5520181316476"></a><ol id="ol5520181316476"><li><p id="p4520141364713"><a name="p4520141364713"></a><a name="p4520141364713"></a><strong id="b45816387277"><a name="b45816387277"></a><a name="b45816387277"></a>mini</strong>: Displays a <strong id="b10542195774416"><a name="b10542195774416"></a><a name="b10542195774416"></a>minibar</strong> or <strong id="b134141855164411"><a name="b134141855164411"></a><a name="b134141855164411"></a>foldable</strong> panel in its minimum size.</p>
</li><li><p id="p6520191324711"><a name="p6520191324711"></a><a name="p6520191324711"></a><strong id="b2065484932810"><a name="b2065484932810"></a><a name="b2065484932810"></a>half</strong>: Displays a <strong id="b166951703457"><a name="b166951703457"></a><a name="b166951703457"></a>foldable</strong> panel in a medium-sized (halfscreen-like) area.</p>
</li><li><p id="p252018137477"><a name="p252018137477"></a><a name="p252018137477"></a><strong id="b1696104211503"><a name="b1696104211503"></a><a name="b1696104211503"></a>full</strong>: Displays a panel in a large (fullscreen-like) area.</p>
<div class="note" id="note1672712533287"><a name="note1672712533287"></a><a name="note1672712533287"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1672795314285"><a name="p1672795314285"></a><a name="p1672795314285"></a>The returned <strong id="b17504232153714"><a name="b17504232153714"></a><a name="b17504232153714"></a>height</strong> value indicates the content area height. However, when the <strong id="b6111851103715"><a name="b6111851103715"></a><a name="b6111851103715"></a>dragbar</strong> attribute is <strong id="b1019713539372"><a name="b1019713539372"></a><a name="b1019713539372"></a>true</strong>, the <strong id="b21622103812"><a name="b21622103812"></a><a name="b21622103812"></a>height</strong> value is the height of the drag bar plus that of the content area.</p>
</div></div>
</li></ol>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section165301745164719"></a>
Only the following methods are supported. ## Methods
<a name="table20753173210251"></a> The following methods are supported.
<table><thead align="left"><tr id="row575363214257"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p157531032112517"><a name="p157531032112517"></a><a name="p157531032112517"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p77531632132518"><a name="p77531632132518"></a><a name="p77531632132518"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p147531232132512"><a name="p147531232132512"></a><a name="p147531232132512"></a>Triggered when</p>
</th>
</tr>
</thead>
<tbody><tr id="row15753113210251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p2314135812511"><a name="p2314135812511"></a><a name="p2314135812511"></a>show</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p7314115819256"><a name="p7314115819256"></a><a name="p7314115819256"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p0314958162512"><a name="p0314958162512"></a><a name="p0314958162512"></a>Pops the slidable panel up.</p>
</td>
</tr>
<tr id="row393410526251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p7314358182512"><a name="p7314358182512"></a><a name="p7314358182512"></a>close</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p1231455814253"><a name="p1231455814253"></a><a name="p1231455814253"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p10314105842512"><a name="p10314105842512"></a><a name="p10314105842512"></a>Closes the slidable panel that has been popped up.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section36743614499"></a> | Name | Parameter | Description |
| ----- | ---- | ------------- |
| show | - | Pops the slidable panel up.|
| close | - | Closes the slidable panel that has been popped up.|
```
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="doc-page"> <div class="doc-page">
<div class="btn-div"> <div class="btn-div">
...@@ -476,7 +102,7 @@ Only the following methods are supported. ...@@ -476,7 +102,7 @@ Only the following methods are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.doc-page { .doc-page {
flex-direction: column; flex-direction: column;
...@@ -515,7 +141,7 @@ Only the following methods are supported. ...@@ -515,7 +141,7 @@ Only the following methods are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -533,5 +159,4 @@ export default { ...@@ -533,5 +159,4 @@ export default {
} }
``` ```
![](figures/panel6.gif) ![panel6](figures/panel6.gif)
# popup<a name="EN-US_TOPIC_0000001127284822"></a> # popup
The **<popup\>** component is used to display a pop-up to offer instructions after a user clicks a bound control. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> Bubble indication. The **\<popup>** component is used to display a pop-up to offer instructions after a user clicks a bound control.
## Required Permissions
None None
## Child Components<a name="s726c642d8f514b0cb5ef8854fe6ac02c"></a>
All child components are supported. Each **<popup\>** can have only one child component<sup>5+</sup>.
## Attributes<a name="s7ff9da9346504b11aca7015dc689dc67"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row679154543116"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p15904153153119"><a name="p15904153153119"></a><a name="p15904153153119"></a>target</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6904205312310"><a name="p6904205312310"></a><a name="p6904205312310"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p79041853123118"><a name="p79041853123118"></a><a name="p79041853123118"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p4904153173110"><a name="p4904153173110"></a><a name="p4904153173110"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p9904155363115"><a name="p9904155363115"></a><a name="p9904155363115"></a>ID of the target element. Dynamic switch is not supported.</p>
</td>
</tr>
<tr id="row17485184243110"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p11904175316315"><a name="p11904175316315"></a><a name="p11904175316315"></a>placement</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1390413531314"><a name="p1390413531314"></a><a name="p1390413531314"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p390465317319"><a name="p390465317319"></a><a name="p390465317319"></a>bottom</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1990415317319"><a name="p1990415317319"></a><a name="p1990415317319"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1990410531316"><a name="p1990410531316"></a><a name="p1990410531316"></a>Position of the pop-up. Available values are as follows:</p>
<a name="ul1190565393119"></a><a name="ul1190565393119"></a><ul id="ul1190565393119"><li><strong id="b15820759192312"><a name="b15820759192312"></a><a name="b15820759192312"></a>left</strong>: The pop-up is displayed on the left of the target item.</li><li><strong id="b16901171419245"><a name="b16901171419245"></a><a name="b16901171419245"></a>right</strong>: The pop-up is displayed on the right of the target item.</li><li><strong id="b1499931915246"><a name="b1499931915246"></a><a name="b1499931915246"></a>top</strong>: The pop-up is displayed at the top of the target item.</li><li><strong id="b4343193516249"><a name="b4343193516249"></a><a name="b4343193516249"></a>bottom</strong>: The pop-up is displayed at the bottom of the target item.</li><li><strong id="b64261744192420"><a name="b64261744192420"></a><a name="b64261744192420"></a>topLeft</strong>: The pop-up is displayed on the upper left of the target item.</li><li><strong id="b612225418245"><a name="b612225418245"></a><a name="b612225418245"></a>topRight</strong>: The pop-up is displayed on the upper right of the target item.</li><li><strong id="b19405122515"><a name="b19405122515"></a><a name="b19405122515"></a>bottomLeft</strong>: The pop-up is displayed on the bottom left of the target item.</li><li><strong id="b1069401942019"><a name="b1069401942019"></a><a name="b1069401942019"></a>bottomRight</strong>: The pop-up is displayed on the bottom right of the target item.</li></ul>
</td>
</tr>
<tr id="row5684114975"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p156851846718"><a name="p156851846718"></a><a name="p156851846718"></a>keepalive<sup id="sup7289771114"><a name="sup7289771114"></a><a name="sup7289771114"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p13685642077"><a name="p13685642077"></a><a name="p13685642077"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p16685164777"><a name="p16685164777"></a><a name="p16685164777"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1068513410710"><a name="p1068513410710"></a><a name="p1068513410710"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p121401832662"><a name="p121401832662"></a><a name="p121401832662"></a>Whether to retain this pop-up.</p>
<p id="p0676162715614"><a name="p0676162715614"></a><a name="p0676162715614"></a><strong id="b1667616271964"><a name="b1667616271964"></a><a name="b1667616271964"></a>true</strong>: The pop-up does not disappear when users tap other areas or switch the page. To hide the pop-up, you need to call the <strong id="b166761527866"><a name="b166761527866"></a><a name="b166761527866"></a>hide</strong> method.</p>
<p id="p1661313358613"><a name="p1661313358613"></a><a name="p1661313358613"></a><strong id="b1343817329515"><a name="b1343817329515"></a><a name="b1343817329515"></a>false</strong>: The pop-up disappears when users tap other areas or switch the page.</p>
</td>
</tr>
<tr id="row99782190913"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p397971910920"><a name="p397971910920"></a><a name="p397971910920"></a>clickable<sup id="sup143370106114"><a name="sup143370106114"></a><a name="sup143370106114"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p149793191095"><a name="p149793191095"></a><a name="p149793191095"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p197981917920"><a name="p197981917920"></a><a name="p197981917920"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1197914193916"><a name="p1197914193916"></a><a name="p1197914193916"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p39792192095"><a name="p39792192095"></a><a name="p39792192095"></a>Whether to display the pop-up when users click the bound control. If this parameter is set to <strong id="b12988162164619"><a name="b12988162164619"></a><a name="b12988162164619"></a>false</strong>, the pop-up can be triggered only by a method call.</p>
</td>
</tr>
<tr id="row94796310119"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p174804313111"><a name="p174804313111"></a><a name="p174804313111"></a>arrowoffset<sup id="sup1520573571311"><a name="sup1520573571311"></a><a name="sup1520573571311"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1948053131110"><a name="p1948053131110"></a><a name="p1948053131110"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p6480831191117"><a name="p6480831191117"></a><a name="p6480831191117"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p8480153151112"><a name="p8480153151112"></a><a name="p8480153151112"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p548093131119"><a name="p548093131119"></a><a name="p548093131119"></a>Offset of the pop-up arrow. By default, the arrow is centered. A positive value means that the arrow moves along the language direction (LTR or RTL), and a negative value means that the arrow moves along the opposite direction of the language direction.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- The **focusable** attribute is not supported.
## Styles<a name="s472a5052130e49bca059adfe7bb6b96d"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table9160202272017"></a>
<table><thead align="left"><tr id="row15160122212204"><th class="cellrowborder" valign="top" width="12.688731126887312%" id="mcps1.1.6.1.1"><p id="p5160182214208"><a name="p5160182214208"></a><a name="p5160182214208"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="10.47895210478952%" id="mcps1.1.6.1.2"><p id="p0160122232018"><a name="p0160122232018"></a><a name="p0160122232018"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.60913908609139%" id="mcps1.1.6.1.3"><p id="p13160152232015"><a name="p13160152232015"></a><a name="p13160152232015"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.28937106289371%" id="mcps1.1.6.1.4"><p id="p101617229209"><a name="p101617229209"></a><a name="p101617229209"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="61.933806619338064%" id="mcps1.1.6.1.5"><p id="p1616162216202"><a name="p1616162216202"></a><a name="p1616162216202"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row191611622172010"><td class="cellrowborder" valign="top" width="12.688731126887312%" headers="mcps1.1.6.1.1 "><p id="p1816142292013"><a name="p1816142292013"></a><a name="p1816142292013"></a>mask-color</p>
</td>
<td class="cellrowborder" valign="top" width="10.47895210478952%" headers="mcps1.1.6.1.2 "><p id="p516152217201"><a name="p516152217201"></a><a name="p516152217201"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="8.60913908609139%" headers="mcps1.1.6.1.3 "><p id="p11161102218207"><a name="p11161102218207"></a><a name="p11161102218207"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.28937106289371%" headers="mcps1.1.6.1.4 "><p id="p8161162282014"><a name="p8161162282014"></a><a name="p8161162282014"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="61.933806619338064%" headers="mcps1.1.6.1.5 "><p id="p1416162202014"><a name="p1416162202014"></a><a name="p1416162202014"></a>Color configuration of the mask layer. By default, the mask layer is completely transparent.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- Position-related styles are not supported.
## Events<a name="section1295913853210"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameters</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row84115915325"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p1458817720332"><a name="p1458817720332"></a><a name="p1458817720332"></a>visibilitychange</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p115888783316"><a name="p115888783316"></a><a name="p115888783316"></a>{ visibility: boolean }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p558817173314"><a name="p558817173314"></a><a name="p558817173314"></a>Triggered when a pop-up appears or disappears.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section1970516568131"></a>
Only the following methods are supported.
<a name="table20753173210251"></a>
<table><thead align="left"><tr id="row575363214257"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p157531032112517"><a name="p157531032112517"></a><a name="p157531032112517"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p id="p77531632132518"><a name="p77531632132518"></a><a name="p77531632132518"></a>Parameters</p>
</th>
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p id="p147531232132512"><a name="p147531232132512"></a><a name="p147531232132512"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row15753113210251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p2314135812511"><a name="p2314135812511"></a><a name="p2314135812511"></a>show<sup id="sup969153720142"><a name="sup969153720142"></a><a name="sup969153720142"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p7314115819256"><a name="p7314115819256"></a><a name="p7314115819256"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p0314958162512"><a name="p0314958162512"></a><a name="p0314958162512"></a>Pops up a message.</p>
</td>
</tr>
<tr id="row393410526251"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p7314358182512"><a name="p7314358182512"></a><a name="p7314358182512"></a>hide<sup id="sup16463154010141"><a name="sup16463154010141"></a><a name="sup16463154010141"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p id="p1231455814253"><a name="p1231455814253"></a><a name="p1231455814253"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p id="p10314105842512"><a name="p10314105842512"></a><a name="p10314105842512"></a>Hides a pop-up.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>1. Attributes and styles of a **<popup\>** component cannot be dynamically updated.
>2. Margins of a pop-up take effect depending on its position relative to the target element. For example, if the pop-up is below the target element, only **margin-top** takes effect; if the pop-up displays on the upper left of the target element, only **margin-bottom** and **margin-right** take effect.
>3. Styles set for the four borders of a pop-up must be the same. If they are different and the border radius is **0**, the first configured border style \(in the sequence of left, top, right, and bottom\) takes effect. Otherwise, the **border** attribute does not take effect.
>4. The click event bound to the target element of a pop-up does not take effect.
## Example Code<a name="section29231018162418"></a>
``` ## Child Components
This component supports only one child component.<sup>5+</sup>
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| target | string | - | Yes| ID of the target element. Dynamic switch is not supported.|
| placement | string | bottom | No| Position of the pop-up. Available values are as follows:<br>- **left**: The pop-up is displayed on the left of the target item.<br>- **right**: The pop-up is displayed on the right of the target item.<br>- **top**: The pop-up is displayed at the top of the target item.<br>- **bottom**: The pop-up is displayed at the bottom of the target item.<br>- **topLeft**: The pop-up is displayed on the upper left of the target item.<br>- **topRight**: The pop-up is displayed on the upper right of the target item.<br>- **bottomLeft**: The pop-up is displayed on the bottom left of the target item.<br>- **bottomRight**: The pop-up is displayed on the bottom right of the target item.|
| keepalive<sup>5+</sup> | boolean | false | No| Whether to retain this pop-up. **true**: The pop-up does not disappear when users tap other areas or switch the page. To hide the pop-up, call the **hide** method.<br>**false**: The pop-up disappears when users tap other areas or switch the page.|
| clickable<sup>5+</sup> | boolean | true | No| Whether to display the pop-up when users click the bound control. If this parameter is set to **false**, the pop-up can be triggered only by a method call.|
| arrowoffset<sup>5+</sup> | &lt;length&gt; | 0 | No| Offset of the pop-up arrow. By default, the arrow is centered. A positive value means that the arrow moves along the language direction (LTR or RTL), and a negative value means that the arrow moves along the opposite direction of the language direction.|
> **NOTE**
>
> The **focusable** attribute is not supported.
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| mask-color | &lt;color&gt; | - | No| Color configuration of the mask layer. By default, the mask layer is completely transparent.|
> **NOTE**
>
> Position-related styles are not supported.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| visibilitychange | { visibility: boolean } | Triggered when a pop-up appears or disappears.|
## Methods
The following methods are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| show<sup>5+</sup> | - | Shows the pop-up.|
| hide<sup>5+</sup> | - | Hides the pop-up.|
> **NOTE**
> 1. Attributes and styles of a **\<popup>** component cannot be dynamically updated.
>
> 2. Margins of a pop-up take effect depending on its position relative to the target element. For example, if the pop-up is below the target element, only **margin-top** takes effect; if the pop-up displays on the upper left of the target element, only **margin-bottom** and **margin-right** take effect.
>
> 3. Styles set for the four borders of a pop-up must be the same. If they are different and the border radius is **0**, the first configured border style (in the sequence of left, top, right, and bottom) takes effect. Otherwise, the **border** attribute does not take effect.
>
> 4. The click event bound to the target element of a pop-up does not take effect.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text id="text">Click to show the pop-up</text> <text id="text">Click to show the pop-up</text>
...@@ -199,7 +89,7 @@ Only the following methods are supported. ...@@ -199,7 +89,7 @@ Only the following methods are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -219,7 +109,7 @@ Only the following methods are supported. ...@@ -219,7 +109,7 @@ Only the following methods are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt' import prompt from '@system.prompt'
export default { export default {
...@@ -238,5 +128,4 @@ export default { ...@@ -238,5 +128,4 @@ export default {
} }
``` ```
![](figures/en-us_image_0000001178886129.png) ![en-us_image_0000001178886129](figures/en-us_image_0000001178886129.png)
# refresh<a name="EN-US_TOPIC_0000001173164669"></a> # refresh
The **<refresh\>** component is used to pull down to refresh the page. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **<Refresh\>** component is used to refresh a page through a pull-down gesture.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Components
Supported Supported
## Attributes<a name="section2907183951110"></a>
## Attributes
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p> | Name| Type| Default Value| Mandatory| Description|
</th> | -------- | -------- | -------- | -------- | -------- |
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p> | offset | &lt;length&gt; | - | No| Distance to the top of the parent component from the **<Refresh\>** component that comes to rest after a successful pull-down gesture.|
</th> | refreshing | boolean | false | No| Whether the **\<refresh>** component is being used for refreshing.|
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p> | type | string | auto | No| Dynamic effect when the component is refreshed. Two options are available and cannot be modified dynamically.<br>- **auto**: default effect. When the list is pulled to the top, the list does not move. When the list is pulled to the bottom, a circle is displayed.<br>- **pulldown**: When the list is pulled to the top, users can continue to pull down to trigger a refresh. The rebound effect will appear after the refresh. If the child component contains a list, set **scrolleffect** of the list to **no** to prevent drop-down effect conflicts.|
</th> | lasttime | boolean | false | No| Whether to display the last update time. The character string format is **last update time: XXXX**, where **XXXX** is displayed based on the certain time and date formats and cannot be dynamically modified. (It is recommended that this attribute be used when **type** is set to **pulldown**. The fixed distance is at the bottom of the content drop-down area. Pay attention to the **offset** attribute setting to prevent overlapping.)|
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p> | timeoffset<sup>6+</sup> | &lt;length&gt; | - | No| Distance between the update time and the top of the parent component.|
</th> | friction | number | 42 | No| Pull-down friction coefficient. The value ranges from 0 to 100. A larger value indicates a more responsive component. For example, if a user pulls the component down 100 px, it will actually move 100 * **friction**% px.|
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr> ## Styles
</thead>
<tbody><tr id="row9157554193514"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p178012583610"><a name="p178012583610"></a><a name="p178012583610"></a>offset</p> In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1880112512360"><a name="p1880112512360"></a><a name="p1880112512360"></a>&lt;length&gt;</p> | Name| Type| Default Value| Mandatory| Description|
</td> | -------- | -------- | -------- | -------- | -------- |
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p4801551360"><a name="p4801551360"></a><a name="p4801551360"></a>-</p> | background-color | &lt;color&gt; | white | No| Background color of the **\<refresh>** component.|
</td> | progress-color | &lt;color&gt; | black | No| Loading color of the **\<refresh>** component.|
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p880112519366"><a name="p880112519366"></a><a name="p880112519366"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p380114563617"><a name="p380114563617"></a><a name="p380114563617"></a>Distance to the top of the parent component from the <strong id="b179761137151712"><a name="b179761137151712"></a><a name="b179761137151712"></a>&lt;refresh&gt;</strong> component that comes to rest after a successful swipe gesture.</p> ## Events
</td>
</tr>
<tr id="row125231450153511"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1380145163611"><a name="p1380145163611"></a><a name="p1380145163611"></a>refreshing</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p108011457365"><a name="p108011457365"></a><a name="p108011457365"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p128011554364"><a name="p128011554364"></a><a name="p128011554364"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p480119563613"><a name="p480119563613"></a><a name="p480119563613"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p28011856362"><a name="p28011856362"></a><a name="p28011856362"></a>Whether the <strong id="b1342720507196"><a name="b1342720507196"></a><a name="b1342720507196"></a>&lt;refresh&gt;</strong> component is being used for refreshing.</p>
</td>
</tr>
<tr id="row1752375015356"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1480116513611"><a name="p1480116513611"></a><a name="p1480116513611"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p11801105143616"><a name="p11801105143616"></a><a name="p11801105143616"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p198028518361"><a name="p198028518361"></a><a name="p198028518361"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p680275173619"><a name="p680275173619"></a><a name="p680275173619"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p9802205183619"><a name="p9802205183619"></a><a name="p9802205183619"></a>Dynamic effect when the component is refreshed. Two options are available and cannot be modified dynamically.</p>
<a name="ul0802951367"></a><a name="ul0802951367"></a><ul id="ul0802951367"><li><strong id="b0351155943013"><a name="b0351155943013"></a><a name="b0351155943013"></a>auto</strong>: default effect. When the list is pulled to the top, the list does not move. When the list is pulled to the bottom, a circle is displayed.</li><li><strong id="b12317132114318"><a name="b12317132114318"></a><a name="b12317132114318"></a>pulldown</strong>: When the list is pulled to the top, users can continue to pull down to trigger a refresh. The rebound effect will appear after the refresh. If the child component contains a list, set <strong id="b1218171023213"><a name="b1218171023213"></a><a name="b1218171023213"></a>scrolleffect</strong> of the list to <strong id="b1152941417327"><a name="b1152941417327"></a><a name="b1152941417327"></a>no</strong> to prevent drop-down effect conflicts.</li></ul>
</td>
</tr>
<tr id="row2303174523514"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p17802951363"><a name="p17802951363"></a><a name="p17802951363"></a>lasttime</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p580235153616"><a name="p580235153616"></a><a name="p580235153616"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p198026510362"><a name="p198026510362"></a><a name="p198026510362"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p118029511366"><a name="p118029511366"></a><a name="p118029511366"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1880211583612"><a name="p1880211583612"></a><a name="p1880211583612"></a>Whether to display the last update time. The character string format is <strong id="b46471930153316"><a name="b46471930153316"></a><a name="b46471930153316"></a>last update time: XXXX</strong>, where <strong id="b142341139133312"><a name="b142341139133312"></a><a name="b142341139133312"></a>XXXX</strong> is displayed based on the time and date display specifications and cannot be dynamically modified. (It is recommended that this attribute be used when <strong id="b22347013416"><a name="b22347013416"></a><a name="b22347013416"></a>type</strong> is set to <strong id="b20303548342"><a name="b20303548342"></a><a name="b20303548342"></a>pulldown</strong>. The fixed distance is at the bottom of the content drop-down area. Pay attention to the <strong id="b18265168348"><a name="b18265168348"></a><a name="b18265168348"></a>offset</strong> attribute setting to prevent overlapping.)</p>
</td>
</tr>
<tr id="row119861446131017"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1098734616104"><a name="p1098734616104"></a><a name="p1098734616104"></a>timeoffset<sup id="sup2158132916489"><a name="sup2158132916489"></a><a name="sup2158132916489"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p59872046111017"><a name="p59872046111017"></a><a name="p59872046111017"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1198724661014"><a name="p1198724661014"></a><a name="p1198724661014"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p298764616106"><a name="p298764616106"></a><a name="p298764616106"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p12987154619106"><a name="p12987154619106"></a><a name="p12987154619106"></a>Sets the distance between the update time and the top of the parent component.</p>
</td>
</tr>
<tr id="row08492042113518"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p11802105143616"><a name="p11802105143616"></a><a name="p11802105143616"></a>friction</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1180265153613"><a name="p1180265153613"></a><a name="p1180265153613"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p128026563620"><a name="p128026563620"></a><a name="p128026563620"></a>42</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11802185153615"><a name="p11802185153615"></a><a name="p11802185153615"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p118021351362"><a name="p118021351362"></a><a name="p118021351362"></a>Pull-down friction coefficient. The value ranges from <strong id="b7887020335"><a name="b7887020335"></a><a name="b7887020335"></a>0</strong> to <strong id="b81365257313"><a name="b81365257313"></a><a name="b81365257313"></a>100</strong>. A larger value indicates a more responsive component. For example, if a user pulls the component down 100 px, it will actually move 100 * <strong id="b2130757132018"><a name="b2130757132018"></a><a name="b2130757132018"></a>friction</strong>% px.</p>
<div class="note" id="note204304260349"><a name="note204304260349"></a><a name="note204304260349"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1343012264345"><a name="p1343012264345"></a><a name="p1343012264345"></a></p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section1893981522413"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table1493916152248"></a>
<table><thead align="left"><tr id="row16940141532414"><th class="cellrowborder" valign="top" width="25.03%" id="mcps1.1.6.1.1"><p id="p994031519247"><a name="p994031519247"></a><a name="p994031519247"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="18.86%" id="mcps1.1.6.1.2"><p id="p179406154245"><a name="p179406154245"></a><a name="p179406154245"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.76%" id="mcps1.1.6.1.3"><p id="p15940161517242"><a name="p15940161517242"></a><a name="p15940161517242"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.449999999999999%" id="mcps1.1.6.1.4"><p id="p1694061552419"><a name="p1694061552419"></a><a name="p1694061552419"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="37.9%" id="mcps1.1.6.1.5"><p id="p29401815132419"><a name="p29401815132419"></a><a name="p29401815132419"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row109404152249"><td class="cellrowborder" valign="top" width="25.03%" headers="mcps1.1.6.1.1 "><p id="p994017159246"><a name="p994017159246"></a><a name="p994017159246"></a>background-color</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.1.6.1.2 "><p id="p12940201582418"><a name="p12940201582418"></a><a name="p12940201582418"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.76%" headers="mcps1.1.6.1.3 "><p id="p16940215132418"><a name="p16940215132418"></a><a name="p16940215132418"></a>white</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p14940151592415"><a name="p14940151592415"></a><a name="p14940151592415"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.9%" headers="mcps1.1.6.1.5 "><p id="p12940181519248"><a name="p12940181519248"></a><a name="p12940181519248"></a>Background color of the <strong id="b6261744123520"><a name="b6261744123520"></a><a name="b6261744123520"></a>&lt;refresh&gt;</strong> component.</p>
</td>
</tr>
<tr id="row169401315182419"><td class="cellrowborder" valign="top" width="25.03%" headers="mcps1.1.6.1.1 "><p id="p69401415152410"><a name="p69401415152410"></a><a name="p69401415152410"></a>progress-color</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.1.6.1.2 "><p id="p16940161522412"><a name="p16940161522412"></a><a name="p16940161522412"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.76%" headers="mcps1.1.6.1.3 "><p id="p2940171518246"><a name="p2940171518246"></a><a name="p2940171518246"></a>black</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p594041514245"><a name="p594041514245"></a><a name="p594041514245"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="37.9%" headers="mcps1.1.6.1.5 "><p id="p169402151243"><a name="p169402151243"></a><a name="p169402151243"></a>Loading color of the <strong id="b10245113211611"><a name="b10245113211611"></a><a name="b10245113211611"></a>&lt;refresh&gt;</strong> component.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section3892191911214"></a>
The following events are supported. The following events are supported.
<a name="table71957715020"></a> | Name| Parameter| Description|
<table><thead align="left"><tr id="row4224147104"><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p id="p11224575017"><a name="p11224575017"></a><a name="p11224575017"></a>Name</p> | -------- | -------- | -------- |
</th> | refresh | { refreshing: refreshingValue } | Triggered when the **\<refresh>** component is pulled down and the refresh status changes. Available values are as follows:<br>- **false**: The **\<refresh>** component is being pulled down.<br>- **true**: The **\<refresh>** component is not being pulled down.|
<th class="cellrowborder" valign="top" width="30.79%" id="mcps1.1.4.1.2"><p id="p13225377018"><a name="p13225377018"></a><a name="p13225377018"></a>Parameter</p> | pulldown | { state: string } | Triggered when a user starts or stops pulling down the **\<refresh>** component. Available values are as follows:<br>- **start**: The pull-down starts.<br>- **end**: The pull-down ends.|
</th>
<th class="cellrowborder" valign="top" width="50.74999999999999%" id="mcps1.1.4.1.3"><p id="p19225197001"><a name="p19225197001"></a><a name="p19225197001"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row9225278016"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p6225187706"><a name="p6225187706"></a><a name="p6225187706"></a>refresh</p>
</td>
<td class="cellrowborder" valign="top" width="30.79%" headers="mcps1.1.4.1.2 "><p id="p1422514714013"><a name="p1422514714013"></a><a name="p1422514714013"></a>{ refreshing: refreshingValue }</p>
</td>
<td class="cellrowborder" valign="top" width="50.74999999999999%" headers="mcps1.1.4.1.3 "><p id="p15225575017"><a name="p15225575017"></a><a name="p15225575017"></a>Triggered when the <strong id="b152251728113018"><a name="b152251728113018"></a><a name="b152251728113018"></a>&lt;refresh&gt;</strong> component is pulled down and the refresh status changes. Available values are as follows:</p>
<a name="ul96951626943"></a><a name="ul96951626943"></a><ul id="ul96951626943"><li><strong id="b18264193215"><a name="b18264193215"></a><a name="b18264193215"></a>false</strong>: The <strong id="b01351252103212"><a name="b01351252103212"></a><a name="b01351252103212"></a>&lt;refresh&gt;</strong> component is being pulled down.</li><li><strong id="b610561314337"><a name="b610561314337"></a><a name="b610561314337"></a>true</strong>: The <strong id="b2742219336"><a name="b2742219336"></a><a name="b2742219336"></a>&lt;refresh&gt;</strong> component is not being pulled down.</li></ul>
</td>
</tr>
<tr id="row13275847193920"><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p id="p42761147173920"><a name="p42761147173920"></a><a name="p42761147173920"></a>pulldown</p>
</td>
<td class="cellrowborder" valign="top" width="30.79%" headers="mcps1.1.4.1.2 "><p id="p227664711392"><a name="p227664711392"></a><a name="p227664711392"></a>{ state: string }</p>
</td>
<td class="cellrowborder" valign="top" width="50.74999999999999%" headers="mcps1.1.4.1.3 "><p id="p527644753917"><a name="p527644753917"></a><a name="p527644753917"></a>Triggered when a user starts or stops pulling down the <strong id="b101091622103416"><a name="b101091622103416"></a><a name="b101091622103416"></a>&lt;refresh&gt;</strong> component. Available values are as follows:</p>
<a name="ul225113709"></a><a name="ul225113709"></a><ul id="ul225113709"><li><strong id="b18546112103519"><a name="b18546112103519"></a><a name="b18546112103519"></a>start</strong>: The pull-down starts.</li><li><strong id="b1978717723516"><a name="b1978717723516"></a><a name="b1978717723516"></a>end</strong>: The pull-down ends.</li></ul>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are not supported.
## Example<a name="section1050103282219"></a>
```
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are not supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<refresh refreshing="{{fresh}}" onrefresh="refresh"> <refresh refreshing="{{fresh}}" onrefresh="refresh">
...@@ -194,7 +72,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor ...@@ -194,7 +72,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -227,7 +105,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor ...@@ -227,7 +105,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are not suppor
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -238,7 +116,7 @@ export default { ...@@ -238,7 +116,7 @@ export default {
onInit() { onInit() {
this.list = []; this.list = [];
for (var i = 0; i <= 3; i++) { for (var i = 0; i <= 3; i++) {
var item ='List element' + i; var item ='List element' + i;
this.list.push(item); this.list.push(item);
} }
}, },
...@@ -260,5 +138,4 @@ export default { ...@@ -260,5 +138,4 @@ export default {
} }
``` ```
![](figures/en-us_image_0000001150719520.gif) ![en-us_image_0000001150719520](figures/en-us_image_0000001150719520.gif)
# stack<a name="EN-US_TOPIC_0000001127125064"></a> # stack
The **<stack\>** component provides a stack container where child components are successively stacked and the latter one overwrites the previous one. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<Stack>** component provides a stack container where child components are successively stacked and the latter one overwrites the previous one.
## Required Permissions
None None
## Child Components<a name="s2936fc34a22b44aa8389d1ec3de8fa61"></a>
## Child Components
Supported Supported
## Attributes<a name="s7207d4d586504fa3be62558273017fbe"></a>
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported. ## Attributes
## Styles<a name="section1774719169253"></a> The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
Styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section1948143416285"></a> ## Styles
Events in [Universal Events](js-components-common-events.md) are supported. The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported. ## Events
## Example<a name="section18137649112711"></a> The [universal events](../arkui-js/js-components-common-events.md) are supported.
``` ## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<stack class="stack-parent"> <stack class="stack-parent">
<div class="back-child bd-radius"></div> <div class="back-child bd-radius"></div>
...@@ -37,7 +46,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -37,7 +46,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</stack> </stack>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.stack-parent { .stack-parent {
width: 400px; width: 400px;
...@@ -68,5 +77,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -68,5 +77,4 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
![](figures/en-us_image_0000001127284958.png) ![en-us_image_0000001127284958](figures/en-us_image_0000001127284958.png)
# swiper<a name="EN-US_TOPIC_0000001173164745"></a> # swiper
The **<swiper\>** component provides a container that allows users to switch among child components by swiping operations. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<Swiper>** component provides a container that allows users to switch among child components using swipe gestures.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
All child components except **<list\>** are supported. ## Child Components
## Attributes<a name="section2907183951110"></a> Supported
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a> ## Attributes
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1319425616340"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1892321283515"><a name="p1892321283515"></a><a name="p1892321283515"></a>index</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p59239126351"><a name="p59239126351"></a><a name="p59239126351"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p492315120357"><a name="p492315120357"></a><a name="p492315120357"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p8923141253518"><a name="p8923141253518"></a><a name="p8923141253518"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p19923012153517"><a name="p19923012153517"></a><a name="p19923012153517"></a>Index of a child component currently displayed in the container.</p>
</td>
</tr>
<tr id="row165481652113414"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p109230127357"><a name="p109230127357"></a><a name="p109230127357"></a>autoplay </p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6923151220359"><a name="p6923151220359"></a><a name="p6923151220359"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p39241112163515"><a name="p39241112163515"></a><a name="p39241112163515"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p19924912113514"><a name="p19924912113514"></a><a name="p19924912113514"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p192451253512"><a name="p192451253512"></a><a name="p192451253512"></a>Whether to enable autoplay for child component switching. If this attribute is <strong id="b15681104972613"><a name="b15681104972613"></a><a name="b15681104972613"></a>true</strong>, the indicator does not take effect<sup id="sup285913711416"><a name="sup285913711416"></a><a name="sup285913711416"></a>5+</sup>.</p>
</td>
</tr>
<tr id="row054835211347"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p592411211350"><a name="p592411211350"></a><a name="p592411211350"></a>interval </p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p99243129357"><a name="p99243129357"></a><a name="p99243129357"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p14924111218354"><a name="p14924111218354"></a><a name="p14924111218354"></a>3000</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p199241612143519"><a name="p199241612143519"></a><a name="p199241612143519"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p15924121219354"><a name="p15924121219354"></a><a name="p15924121219354"></a>Autoplay interval, in milliseconds, when autoplay is enabled.</p>
</td>
</tr>
<tr id="row3548452123418"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p392419124357"><a name="p392419124357"></a><a name="p392419124357"></a>indicator </p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1992419126353"><a name="p1992419126353"></a><a name="p1992419126353"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p129245120351"><a name="p129245120351"></a><a name="p129245120351"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p39241412123514"><a name="p39241412123514"></a><a name="p39241412123514"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p139247126354"><a name="p139247126354"></a><a name="p139247126354"></a>Whether to enable the indicator. The default value is <strong id="b11169818165715"><a name="b11169818165715"></a><a name="b11169818165715"></a>true</strong>.</p>
</td>
</tr>
<tr id="row2549452153416"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p11924181214359"><a name="p11924181214359"></a><a name="p11924181214359"></a>digital<sup id="sup862644131518"><a name="sup862644131518"></a><a name="sup862644131518"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p992411203518"><a name="p992411203518"></a><a name="p992411203518"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p99241312173519"><a name="p99241312173519"></a><a name="p99241312173519"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1692471216354"><a name="p1692471216354"></a><a name="p1692471216354"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p892412121355"><a name="p892412121355"></a><a name="p892412121355"></a>Whether to enable the digital indicator. The default value is <strong id="b186731053201012"><a name="b186731053201012"></a><a name="b186731053201012"></a>false</strong>.</p>
<div class="note" id="note592581253511"><a name="note592581253511"></a><a name="note592581253511"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1892581233520"><a name="p1892581233520"></a><a name="p1892581233520"></a>The digital indicator takes effect only when <strong id="b129911746141816"><a name="b129911746141816"></a><a name="b129911746141816"></a>indicator</strong> is set to <strong id="b1176765601811"><a name="b1176765601811"></a><a name="b1176765601811"></a>true</strong>.</p>
</div></div>
</td>
</tr>
<tr id="row18467181913175"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p104671419151719"><a name="p104671419151719"></a><a name="p104671419151719"></a>indicatordisabled<sup id="sup0227116141915"><a name="sup0227116141915"></a><a name="sup0227116141915"></a>5+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p64671319171712"><a name="p64671319171712"></a><a name="p64671319171712"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p20467119161717"><a name="p20467119161717"></a><a name="p20467119161717"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11467519121712"><a name="p11467519121712"></a><a name="p11467519121712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p12467101911179"><a name="p12467101911179"></a><a name="p12467101911179"></a>Whether gesture operations are disabled on the indicator. If this attribute is set to <strong id="b76131411183611"><a name="b76131411183611"></a><a name="b76131411183611"></a>true</strong>, the indicator does not respond to clicking or dragging operations.</p>
</td>
</tr>
<tr id="row813404683416"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p29251112133511"><a name="p29251112133511"></a><a name="p29251112133511"></a>loop</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p59251129353"><a name="p59251129353"></a><a name="p59251129353"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1492511216359"><a name="p1492511216359"></a><a name="p1492511216359"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1925191217350"><a name="p1925191217350"></a><a name="p1925191217350"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1492511233518"><a name="p1492511233518"></a><a name="p1492511233518"></a>Whether to enable looping.</p>
</td>
</tr>
<tr id="row959023815340"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p18926141243510"><a name="p18926141243510"></a><a name="p18926141243510"></a>duration</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1592618127351"><a name="p1592618127351"></a><a name="p1592618127351"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p49269123351"><a name="p49269123351"></a><a name="p49269123351"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p119261212183513"><a name="p119261212183513"></a><a name="p119261212183513"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p79261112123512"><a name="p79261112123512"></a><a name="p79261112123512"></a>Duration of the autoplay for child component switching.</p>
</td>
</tr>
<tr id="row448465042919"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1292671273516"><a name="p1292671273516"></a><a name="p1292671273516"></a>vertical</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p09261312133515"><a name="p09261312133515"></a><a name="p09261312133515"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p6926191283518"><a name="p6926191283518"></a><a name="p6926191283518"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p5926101223516"><a name="p5926101223516"></a><a name="p5926101223516"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p9926141215356"><a name="p9926141215356"></a><a name="p9926141215356"></a>Whether the swipe gesture is performed vertically. A vertical swipe uses the vertical indicator.</p>
</td>
</tr>
<tr id="row19614191801116"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p6615101813113"><a name="p6615101813113"></a><a name="p6615101813113"></a>cachedsize<sup id="sup116732071533"><a name="sup116732071533"></a><a name="sup116732071533"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p11615618191116"><a name="p11615618191116"></a><a name="p11615618191116"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p76150185113"><a name="p76150185113"></a><a name="p76150185113"></a>-1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p6615141812113"><a name="p6615141812113"></a><a name="p6615141812113"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p161510182110"><a name="p161510182110"></a><a name="p161510182110"></a>Minimum number of cached items during delayed loading of the <strong id="b1461673213215"><a name="b1461673213215"></a><a name="b1461673213215"></a>&lt;swiper&gt;</strong> component. The value <strong id="b1622894813210"><a name="b1622894813210"></a><a name="b1622894813210"></a>-1</strong> indicates that all content is cached.</p>
</td>
</tr>
<tr id="row188171411181313"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19817711111310"><a name="p19817711111310"></a><a name="p19817711111310"></a>scrolleffect<sup id="sup015918182539"><a name="sup015918182539"></a><a name="sup015918182539"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p58177111138"><a name="p58177111138"></a><a name="p58177111138"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p19817191116131"><a name="p19817191116131"></a><a name="p19817191116131"></a>spring</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1681791141315"><a name="p1681791141315"></a><a name="p1681791141315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p118181116136"><a name="p118181116136"></a><a name="p118181116136"></a>Scroll effect. The options are as follows:</p>
<a name="ul5570142716148"></a><a name="ul5570142716148"></a><ul id="ul5570142716148"><li><strong id="b9832231639"><a name="b9832231639"></a><a name="b9832231639"></a>spring</strong>: Similar to the physical dynamic effect of a spring. After scrolling to the edge, you can continue to scroll for a distance based on the initial speed or by touching the knob of the scrollbar. After you release your hand, the knob is rebounded.</li><li><strong id="b1843310104318"><a name="b1843310104318"></a><a name="b1843310104318"></a>fade</strong>: Similar to the physical dynamic effect of fade. When you scroll to the edge, a wave shape fades. The fade changes according to the speed and scrolling distance.</li><li><strong id="b18395161410313"><a name="b18395161410313"></a><a name="b18395161410313"></a>none</strong>: No effect after the scroll bar is moved to the edge.<div class="note" id="note194872416715"><a name="note194872416715"></a><a name="note194872416715"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p104852416717"><a name="p104852416717"></a><a name="p104852416717"></a>This attribute is valid only when <strong id="b466318259316"><a name="b466318259316"></a><a name="b466318259316"></a>loop</strong> is set to <strong id="b99292718313"><a name="b99292718313"></a><a name="b99292718313"></a>false</strong>.</p>
</div></div>
</li></ul>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section08721578337"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. | Name | Type | Default Value | Mandatory | Description |
| ------------------------------ | ------- | ------ | ---- | ---------------------------------------- |
| index | number | 0 | No | Index of the child component currently displayed in the container. |
| autoplay | boolean | false | No | Whether to enable autoplay for child component switching. If this attribute is **true**, the indicator does not take effect<sup>5+</sup>. |
| interval | number | 3000 | No | Autoplay interval, in milliseconds, when autoplay is enabled. |
| indicator | boolean | true | No | Whether to enable the indicator. The default value is **true**. |
| digital<sup>5+</sup> | boolean | false | No | Whether to enable the digital indicator. The default value is **false**.<br>The digital indicator takes effect only when **indicator** is set to **true**.|
| indicatordisabled<sup>5+</sup> | boolean | false | No | Whether gesture operations are disabled on the indicator. If this attribute is set to **true**, the indicator does not respond to clicking or dragging operations. |
| loop | boolean | true | No | Whether to enable looping. |
| duration | number | - | No | Duration of the autoplay for child component switching. |
| vertical | boolean | false | No | Whether the swipe gesture is performed vertically. A vertical swipe uses the vertical indicator. |
| cachedsize<sup>7+</sup> | number | -1 | No | Minimum number of cached items during delayed loading of the **\<swiper>** component. The value **-1** indicates that all content is cached. |
| scrolleffect<sup>7+</sup> | string | spring | No | Scroll effect. The options are as follows:<br>- **spring**: Similar to the physical dynamic effect of a spring. After scrolling to the edge, you can continue to scroll for a distance based on the initial speed or by touching the knob of the scrollbar. After you release your hand, the knob is rebounded.<br>- **fade**: Similar to the physical dynamic effect of fade. When you scroll to the edge, a wave shape fades. The fade changes according to the speed and scrolling distance.<br>- **none**: No effect after the scroll bar is moved to the edge.<br>This attribute is valid only when **loop** is set to **false**.|
<a name="table887265710335"></a>
<table><thead align="left"><tr id="row128728571331"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p16872857183318"><a name="p16872857183318"></a><a name="p16872857183318"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="18.938106189381063%" id="mcps1.1.6.1.2"><p id="p3872185715335"><a name="p3872185715335"></a><a name="p3872185715335"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.408959104089591%" id="mcps1.1.6.1.3"><p id="p8872115733310"><a name="p8872115733310"></a><a name="p8872115733310"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p48726579333"><a name="p48726579333"></a><a name="p48726579333"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p11872135710338"><a name="p11872135710338"></a><a name="p11872135710338"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row087215753313"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p138721657163318"><a name="p138721657163318"></a><a name="p138721657163318"></a>indicator-color</p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p18873175711338"><a name="p18873175711338"></a><a name="p18873175711338"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p387319579338"><a name="p387319579338"></a><a name="p387319579338"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p14873557133312"><a name="p14873557133312"></a><a name="p14873557133312"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p38731575337"><a name="p38731575337"></a><a name="p38731575337"></a>Fill color of the navigation point indicator.</p>
</td>
</tr>
<tr id="row1387305703318"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p887315773318"><a name="p887315773318"></a><a name="p887315773318"></a>indicator-selected-color </p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p287311574339"><a name="p287311574339"></a><a name="p287311574339"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p1873175716333"><a name="p1873175716333"></a><a name="p1873175716333"></a>#ff007dff</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1487315715332"><a name="p1487315715332"></a><a name="p1487315715332"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p08741578331"><a name="p08741578331"></a><a name="p08741578331"></a>Color of the currently selected navigation point indicator.</p>
</td>
</tr>
<tr id="row28741757123314"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1487455763316"><a name="p1487455763316"></a><a name="p1487455763316"></a>indicator-size </p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p687415578337"><a name="p687415578337"></a><a name="p687415578337"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p13874957103314"><a name="p13874957103314"></a><a name="p13874957103314"></a>4px</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p10874105714335"><a name="p10874105714335"></a><a name="p10874105714335"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1287415572334"><a name="p1287415572334"></a><a name="p1287415572334"></a>Diameter of the navigation point indicator.</p>
</td>
</tr>
<tr id="row38742578331"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p5874957103312"><a name="p5874957103312"></a><a name="p5874957103312"></a>indicator-top|left|right|bottom</p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p18741457183312"><a name="p18741457183312"></a><a name="p18741457183312"></a>&lt;length&gt; | &lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p148741857113313"><a name="p148741857113313"></a><a name="p148741857113313"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p188751357193317"><a name="p188751357193317"></a><a name="p188751357193317"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p28751457163310"><a name="p28751457163310"></a><a name="p28751457163310"></a>Relative position of the indicator in the swiper.</p>
</td>
</tr>
<tr id="row15827160201614"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p682740201616"><a name="p682740201616"></a><a name="p682740201616"></a>next-margin<sup id="sup363181741"><a name="sup363181741"></a><a name="sup363181741"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p1682710012164"><a name="p1682710012164"></a><a name="p1682710012164"></a>&lt;length&gt; | &lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p148271506167"><a name="p148271506167"></a><a name="p148271506167"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p11827130131611"><a name="p11827130131611"></a><a name="p11827130131611"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p082712081614"><a name="p082712081614"></a><a name="p082712081614"></a>Next margin, used to reveal a small part of the next item.</p>
</td>
</tr>
<tr id="row08411354161510"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p6842195461516"><a name="p6842195461516"></a><a name="p6842195461516"></a>previous-margin<sup id="sup43791142644"><a name="sup43791142644"></a><a name="sup43791142644"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="18.938106189381063%" headers="mcps1.1.6.1.2 "><p id="p188423543159"><a name="p188423543159"></a><a name="p188423543159"></a>&lt;length&gt; | &lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.408959104089591%" headers="mcps1.1.6.1.3 "><p id="p1584265416157"><a name="p1584265416157"></a><a name="p1584265416157"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p9842954201518"><a name="p9842954201518"></a><a name="p9842954201518"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1684225411159"><a name="p1684225411159"></a><a name="p1684225411159"></a>Previous margin, used to reveal a small part of the previous item.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section5891352194417"></a> ## Styles
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
<a name="table836435619510"></a> | Name | Type | Default Value | Mandatory | Description |
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p> | ---------------------------------- | ---------------------------------------- | ---------- | ---- | -------------------- |
</th> | indicator-color | &lt;color&gt; | - | No | Fill color of the indicator. |
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p> | indicator-selected-color | &lt;color&gt; | \#ff007dff | No | Color of the currently selected indicator. |
</th> | indicator-size | &lt;length&gt; | 4px | No | Diameter of the indicator. |
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p> | indicator-top\|left\|right\|bottom | &lt;length&gt; \| &lt;percentage&gt; | - | No | Relative position of the indicator in the swiper.|
</th> | next-margin<sup>7+</sup> | &lt;length&gt; \| &lt;percentage&gt; | - | No | Next margin, used to reveal a small part of the next item. |
</tr> | previous-margin<sup>7+</sup> | &lt;length&gt; \| &lt;percentage&gt; | - | No | Previous margin, used to reveal a small part of the previous item. |
</thead>
<tbody><tr id="row135881215451"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p2030252874519"><a name="p2030252874519"></a><a name="p2030252874519"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p123024288459"><a name="p123024288459"></a><a name="p123024288459"></a>{ index: currentIndex }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p4302728104511"><a name="p4302728104511"></a><a name="p4302728104511"></a>Triggered when the index of the currently displayed component changes.</p>
</td>
</tr>
<tr id="row103876164452"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p1830262817457"><a name="p1830262817457"></a><a name="p1830262817457"></a>rotation</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1530220283457"><a name="p1530220283457"></a><a name="p1530220283457"></a>{ value: rotationValue }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p12302172834515"><a name="p12302172834515"></a><a name="p12302172834515"></a>Triggered when the crown of the wearable rotates.</p>
</td>
</tr>
<tr id="row10660153518166"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p166601635101610"><a name="p166601635101610"></a><a name="p166601635101610"></a>animationfinish<sup id="sup19967184217552"><a name="sup19967184217552"></a><a name="sup19967184217552"></a>7+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p156601035201615"><a name="p156601035201615"></a><a name="p156601035201615"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p13660835101610"><a name="p13660835101610"></a><a name="p13660835101610"></a>Triggered when the animation is finished.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section47669296127"></a>
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported. ## Events
<a name="te7404653e7d24f40acacb0305c705aa2"></a> In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
<table><thead align="left"><tr id="r7df84ee4172341538bc618c4345bbdfb"><th class="cellrowborder" valign="top" width="19.439999999999998%" id="mcps1.1.4.1.1"><p id="a84cfe32d70ef464c8469ce267d0d73e8"><a name="a84cfe32d70ef464c8469ce267d0d73e8"></a><a name="a84cfe32d70ef464c8469ce267d0d73e8"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="30.56%" id="mcps1.1.4.1.2"><p id="a9f4903e9b8134a1e9fadce6a61670fb8"><a name="a9f4903e9b8134a1e9fadce6a61670fb8"></a><a name="a9f4903e9b8134a1e9fadce6a61670fb8"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.4.1.3"><p id="a4c4693c36e024fb2a0cb911f30c93c56"><a name="a4c4693c36e024fb2a0cb911f30c93c56"></a><a name="a4c4693c36e024fb2a0cb911f30c93c56"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r8554a956136c49f8a359d08629dad179"><td class="cellrowborder" valign="top" width="19.439999999999998%" headers="mcps1.1.4.1.1 "><p id="aed0f2fb3d4cd4e36a97feb6e7109d93e"><a name="aed0f2fb3d4cd4e36a97feb6e7109d93e"></a><a name="aed0f2fb3d4cd4e36a97feb6e7109d93e"></a>swipeTo</p>
</td>
<td class="cellrowborder" valign="top" width="30.56%" headers="mcps1.1.4.1.2 "><p id="a455221cd9db84f4e8e07d33556a6cc21"><a name="a455221cd9db84f4e8e07d33556a6cc21"></a><a name="a455221cd9db84f4e8e07d33556a6cc21"></a>{ index: number(specified position) }</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.4.1.3 "><p id="a446f14fd895449f68d98b2a7e1c4bd04"><a name="a446f14fd895449f68d98b2a7e1c4bd04"></a><a name="a446f14fd895449f68d98b2a7e1c4bd04"></a>Scrolls the child component to the position at the specified index.</p>
</td>
</tr>
<tr id="row47605285519"><td class="cellrowborder" valign="top" width="19.439999999999998%" headers="mcps1.1.4.1.1 "><p id="p37655213550"><a name="p37655213550"></a><a name="p37655213550"></a>showNext</p>
</td>
<td class="cellrowborder" valign="top" width="30.56%" headers="mcps1.1.4.1.2 "><p id="p117613529552"><a name="p117613529552"></a><a name="p117613529552"></a>None</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.4.1.3 "><p id="p47675220555"><a name="p47675220555"></a><a name="p47675220555"></a>Shows the next child component.</p>
</td>
</tr>
<tr id="row5694155435516"><td class="cellrowborder" valign="top" width="19.439999999999998%" headers="mcps1.1.4.1.1 "><p id="p3694185420554"><a name="p3694185420554"></a><a name="p3694185420554"></a>showPrevious</p>
</td>
<td class="cellrowborder" valign="top" width="30.56%" headers="mcps1.1.4.1.2 "><p id="p369455411559"><a name="p369455411559"></a><a name="p369455411559"></a>None</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.4.1.3 "><p id="p2694135412552"><a name="p2694135412552"></a><a name="p2694135412552"></a>Shows the previous child component.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section1933534232313"></a> | Name | Parameter | Description |
| ---------------------------- | --------------------------------------- | ------------------ |
| change | { index: currentIndex } | Triggered when the index of the currently displayed component changes.|
| rotation | { value: rotationValue } | Triggered when the crown of the wearable rotates. |
| animationfinish<sup>7+</sup> | - | Triggered when the animation is finished. |
``` ## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name | Parameter | Description |
| ------------ | -------------------------------------- | --------------- |
| swipeTo | { index: number(specified position) }| Scrolls the child component to the position at the specified index.|
| showNext | - | Shows the next child component. |
| showPrevious | - | Shows the previous child component. |
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<swiper class="swiper" id="swiper" index="0" indicator="true" loop="true" digital="false" cachedsize="-1" <swiper class="swiper" id="swiper" index="0" indicator="true" loop="true" digital="false" cachedsize="-1"
...@@ -339,7 +93,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods. ...@@ -339,7 +93,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -386,7 +140,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods. ...@@ -386,7 +140,7 @@ In addition to the methods in [Universal Methods](js-components-common-methods.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
swipeTo() { swipeTo() {
...@@ -401,5 +155,4 @@ export default { ...@@ -401,5 +155,4 @@ export default {
} }
``` ```
![](figures/4-0.gif) ![4-0](figures/4-0.gif)
# tab-bar<a name="EN-US_TOPIC_0000001173324603"></a> # tab-bar
**<tab-bar\>** is a child component of **<[tabs](js-components-container-tabs.md)\>** and is used to provide the area to display tab labels. Its child components are horizontally arranged. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> **\<tab-bar>** is a child component of **[\<tabs>](js-components-container-tabs.md)** and is used to provide the area to display tab labels. Its child components are horizontally arranged.
## Required Permissions
None None
## Child Components<a name="sfddaafa400fa4802a6c4344a0cc0f9ed"></a>
## Child Components
Supported Supported
## Attributes<a name="s45d9533b71b049aba681c57db73d9f7b"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| mode | string | scrollable | No| Extensibility of the component width. Available values are as follows:<br>- **scrollable**: The width of a child component is the configured width. When the total width of all child components (including the margins) is greater than the tab-bar width, the child components can scroll horizontally.<br>- **fixed**: The width of a child component equals the tab-bar width divided by the number of child components.|
## Styles
<a name="table20633101642315"></a> The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row535514483277"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p691913535274"><a name="p691913535274"></a><a name="p691913535274"></a>mode</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p20919195319272"><a name="p20919195319272"></a><a name="p20919195319272"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1091935342713"><a name="p1091935342713"></a><a name="p1091935342713"></a>scrollable</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p159191153142712"><a name="p159191153142712"></a><a name="p159191153142712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p129191953112718"><a name="p129191953112718"></a><a name="p129191953112718"></a>Extensibility of the component width. Available values are as follows:</p>
<a name="ul09198536276"></a><a name="ul09198536276"></a><ul id="ul09198536276"><li><strong id="b20114123122910"><a name="b20114123122910"></a><a name="b20114123122910"></a>scrollable</strong>: The width of a child component is the configured width. When the total width of all child components (including the margins) is greater than the tab-bar width, the child components can scroll horizontally.</li><li><strong id="b8929201053917"><a name="b8929201053917"></a><a name="b8929201053917"></a>fixed</strong>: The width of a child component equals the tab-bar width divided by the number of child components.</li></ul>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section193239416388"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported. ## Events
## Events<a name="section71081937192815"></a> The [universal events](../arkui-js/js-components-common-events.md) are supported.
Events in [Universal Events](js-components-common-events.md) are supported.
## Methods<a name="section2279124532420"></a> ## Methods
Methods in [Universal Methods](js-components-common-methods.md) are supported. The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example<a name="section10605165263911"></a>
For details, see the [tabs example code](js-components-container-tabs.md#section14993155318710). ## Example
For details, see [Example in tabs](../arkui-js/js-components-container-tabs.md#example).
# tabs<a name="EN-US_TOPIC_0000001173324585"></a> # tabs
The **<tabs\>** component provides a tab container. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<tabs>** component provides a tab container.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
A **<tabs\>** can wrap at most one **<[tab-bar](js-components-container-tab-bar.md)\>** and at most one **<[tab-content](js-components-container-tab-content.md)\>**.
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row188481425182510"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1123011311254"><a name="p1123011311254"></a><a name="p1123011311254"></a>index</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1223193122517"><a name="p1223193122517"></a><a name="p1223193122517"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1523183172515"><a name="p1523183172515"></a><a name="p1523183172515"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p623183182516"><a name="p623183182516"></a><a name="p623183182516"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p13231103192517"><a name="p13231103192517"></a><a name="p13231103192517"></a>Index of the active tab.</p>
</td>
</tr>
<tr id="row0461622112513"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p12311131122516"><a name="p12311131122516"></a><a name="p12311131122516"></a>vertical</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p423110319253"><a name="p423110319253"></a><a name="p423110319253"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1023118318252"><a name="p1023118318252"></a><a name="p1023118318252"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p42311331102516"><a name="p42311331102516"></a><a name="p42311331102516"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p10231123114251"><a name="p10231123114251"></a><a name="p10231123114251"></a>Whether the tab is vertical. Available values are as follows:</p>
<a name="ul8231123114251"></a><a name="ul8231123114251"></a><ul id="ul8231123114251"><li><strong id="b12577236554"><a name="b12577236554"></a><a name="b12577236554"></a>false</strong>: The <strong id="b17955203312912"><a name="b17955203312912"></a><a name="b17955203312912"></a>&lt;tab-bar&gt;</strong> and <strong id="b14567123617917"><a name="b14567123617917"></a><a name="b14567123617917"></a>&lt;tab-content&gt;</strong> are arranged vertically.</li><li><strong id="b188320450320"><a name="b188320450320"></a><a name="b188320450320"></a>true</strong>: The <strong id="b108915451032"><a name="b108915451032"></a><a name="b108915451032"></a>&lt;tab-bar&gt;</strong> and <strong id="b168917451631"><a name="b168917451631"></a><a name="b168917451631"></a>&lt;tab-content&gt;</strong> are arranged horizontally.</li></ul>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section169548171376"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section3892191911214"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row4918151132616"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p661018582267"><a name="p661018582267"></a><a name="p661018582267"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p15610135815262"><a name="p15610135815262"></a><a name="p15610135815262"></a>{ index: indexValue }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p161015852613"><a name="p161015852613"></a><a name="p161015852613"></a>Triggered upon tab switching.</p>
<div class="note" id="note1551155885118"><a name="note1551155885118"></a><a name="note1551155885118"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1251125818519"><a name="p1251125818519"></a><a name="p1251125818519"></a>This event is not triggered when the <strong id="b3802133719811"><a name="b3802133719811"></a><a name="b3802133719811"></a>index</strong> value is dynamically changed.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
## Example<a name="section14993155318710"></a>
``` ## Child Components
A **\<tabs>** component can wrap at most one **[\<tab-bar>](../arkui-js/js-components-container-tab-bar.md)** and at most one **[\<tab-content>](../arkui-js/js-components-container-tab-content.md)**.
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | ----- | ---- | ---------------------------------------- |
| index | number | 0 | No | Index of the active tab. |
| vertical | boolean | false | No | Whether the tab is vertical. Available values are as follows:<br>- **false**: The **\<tab-bar>** and **\<tab-content>** are arranged vertically.<br>- **true**: The **\<tab-bar>** and **\<tab-content>** are arranged horizontally.|
## Styles
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
| ------ | ------------------------------------ | ----------------------------- |
| change | { index: indexValue } | Triggered upon tab switching. This event is not triggered when the **index** value is dynamically changed.|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<tabs class = "tabs" index="0" vertical="false" onchange="change"> <tabs class = "tabs" index="0" vertical="false" onchange="change">
...@@ -108,7 +66,7 @@ In addition to the events in [Universal Events](js-components-common-events.md) ...@@ -108,7 +66,7 @@ In addition to the events in [Universal Events](js-components-common-events.md)
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -142,7 +100,7 @@ In addition to the events in [Universal Events](js-components-common-events.md) ...@@ -142,7 +100,7 @@ In addition to the events in [Universal Events](js-components-common-events.md)
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
change: function(e) { change: function(e) {
...@@ -151,5 +109,4 @@ export default { ...@@ -151,5 +109,4 @@ export default {
} }
``` ```
![](figures/tab.gif) ![tab](figures/tab.gif)
# Basic Usage<a name="EN-US_TOPIC_0000001127284892"></a> # Basic Usage
Custom components are existing components encapsulated based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. You can introduce a custom component to the host page through **element** as shown in the following code snippet: Custom components are existing components encapsulated based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. You can introduce a custom component to the host page through **element** as shown in the following code snippet:
```html
```
<element name='comp' src='../../common/component/comp.hml'></element> <element name='comp' src='../../common/component/comp.hml'></element>
<div> <div>
<comp prop1='xxxx' @child1="bindParentVmMethod"></comp> <comp prop1='xxxx' @child1="bindParentVmMethod"></comp>
</div> </div>
``` ```
The following is an example of using a custom component with **if-else**:
``` The following is an example of using a custom component with **if-else**:
```html
<element name='comp1' src='../../common/component/comp1/comp1.hml'></element> <element name='comp1' src='../../common/component/comp1/comp1.hml'></element>
<element name='comp2' src='../../common/component/comp2/comp2.hml'></element> <element name='comp2' src='../../common/component/comp2/comp2.hml'></element>
<div> <div>
...@@ -20,46 +19,18 @@ The following is an example of using a custom component with **if-else**: ...@@ -20,46 +19,18 @@ The following is an example of using a custom component with **if-else**:
</div> </div>
``` ```
- The **name** attribute indicates the custom component name \(optional\), which is case-insensitive and is in lowercase by default. The **src** attribute indicates the **.hml** file path \(mandatory\) of the custom component. If **name** is not set, the **.hml** file name is used as the component name by default.
- Event binding: Use **\(on|@\)**_child1_ syntax to bind a child component event to a custom component. In the child component, use **this.$emit\('**_child1_**', \{params:'**_parameter to pass_**'\}\)** for event triggering and value transferring. In the parent component, call **bindParentVmMethod** method and receive the parameters passed from the child component.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>For child component events that are named in camel case, convert the names to kebab case when binding the events to the parent component. For example, use **@children-event** instead of **childrenEvent**: **@children-event="bindParentVmMethod"**.
- The **name** attribute indicates the custom component name (optional), which is case-insensitive and is in lowercase by default. The **src** attribute indicates the **.hml** file path (mandatory) of the custom component. If **name** is not set, the **.hml** file name is used as the component name by default.
**Table 1** Objects - Event binding: Use **(on|@)***child1* syntax to bind a child component event to a custom component. In the child component, use **this.$emit('***child1***', {params:'***parameter to pass***'})** for event triggering and value transferring. In the parent component, call **bindParentVmMethod** method and receive the parameters passed from the child component.
> **NOTE**
>
> For child component events that are named in camel case, convert the names to kebab case when binding the events to the parent component. For example, use **\@children-event** instead of **childrenEvent**: **\@children-event="bindParentVmMethod"**.
<a name="table67211828124016"></a> **Table 1** Objects
<table><thead align="left"><tr id="row108577289405"><th class="cellrowborder" valign="top" width="11.091109110911091%" id="mcps1.2.4.1.1"><p id="p385742814403"><a name="p385742814403"></a><a name="p385742814403"></a>Attribute</p>
</th>
<th class="cellrowborder" valign="top" width="12.96129612961296%" id="mcps1.2.4.1.2"><p id="p19857192816408"><a name="p19857192816408"></a><a name="p19857192816408"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="75.94759475947595%" id="mcps1.2.4.1.3"><p id="p18573288402"><a name="p18573288402"></a><a name="p18573288402"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1085792824019"><td class="cellrowborder" valign="top" width="11.091109110911091%" headers="mcps1.2.4.1.1 "><p id="p115421323762"><a name="p115421323762"></a><a name="p115421323762"></a>data</p>
</td>
<td class="cellrowborder" valign="top" width="12.96129612961296%" headers="mcps1.2.4.1.2 "><p id="p05120283516"><a name="p05120283516"></a><a name="p05120283516"></a>Object/Function</p>
</td>
<td class="cellrowborder" valign="top" width="75.94759475947595%" headers="mcps1.2.4.1.3 "><p id="p105644412409"><a name="p105644412409"></a><a name="p105644412409"></a>Data model of the page. If the attribute is of the function type, the return value must be of the object type. The attribute name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (<strong id="b1663610842111"><a name="b1663610842111"></a><a name="b1663610842111"></a>for</strong>, <strong id="b18647087218"><a name="b18647087218"></a><a name="b18647087218"></a>if</strong>, <strong id="b565218842116"><a name="b565218842116"></a><a name="b565218842116"></a>show</strong>, and <strong id="b0657587218"><a name="b0657587218"></a><a name="b0657587218"></a>tid</strong>).</p>
<p id="p356184410403"><a name="p356184410403"></a><a name="p356184410403"></a>Do not use this attribute and <strong id="b1944710452613"><a name="b1944710452613"></a><a name="b1944710452613"></a>private</strong> or <strong id="b1645518414264"><a name="b1645518414264"></a><a name="b1645518414264"></a>public</strong> at the same time. (Rich)</p>
</td>
</tr>
<tr id="row3857132812406"><td class="cellrowborder" valign="top" width="11.091109110911091%" headers="mcps1.2.4.1.1 "><p id="p88572283404"><a name="p88572283404"></a><a name="p88572283404"></a>props</p>
</td>
<td class="cellrowborder" valign="top" width="12.96129612961296%" headers="mcps1.2.4.1.2 "><p id="p198571828114017"><a name="p198571828114017"></a><a name="p198571828114017"></a>Array/Object</p>
</td>
<td class="cellrowborder" valign="top" width="75.94759475947595%" headers="mcps1.2.4.1.3 "><p id="p3857192844012"><a name="p3857192844012"></a><a name="p3857192844012"></a>Used for communication between components. This attribute can be transferred to components via <strong id="b19615191652119"><a name="b19615191652119"></a><a name="b19615191652119"></a>&lt;tag xxxx='value'&gt;</strong>. A <strong id="b56261916152117"><a name="b56261916152117"></a><a name="b56261916152117"></a>props</strong> name must be in lowercase and cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (<strong id="b11631216152114"><a name="b11631216152114"></a><a name="b11631216152114"></a>for</strong>, <strong id="b86351216202115"><a name="b86351216202115"></a><a name="b86351216202115"></a>if</strong>, <strong id="b864018160215"><a name="b864018160215"></a><a name="b864018160215"></a>show</strong>, and <strong id="b364591612115"><a name="b364591612115"></a><a name="b364591612115"></a>tid</strong>). Currently, <strong id="b129739262211"><a name="b129739262211"></a><a name="b129739262211"></a>props</strong> does not support functions.</p>
</td>
</tr>
<tr id="row8842155461510"><td class="cellrowborder" valign="top" width="11.091109110911091%" headers="mcps1.2.4.1.1 "><p id="p17843155411153"><a name="p17843155411153"></a><a name="p17843155411153"></a>computed</p>
</td>
<td class="cellrowborder" valign="top" width="12.96129612961296%" headers="mcps1.2.4.1.2 "><p id="p1884365421515"><a name="p1884365421515"></a><a name="p1884365421515"></a>Object</p>
</td>
<td class="cellrowborder" valign="top" width="75.94759475947595%" headers="mcps1.2.4.1.3 "><p id="p6422712153413"><a name="p6422712153413"></a><a name="p6422712153413"></a>Used for pre-processing an object for reading and setting. The result is cached. The name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words.</p>
</td>
</tr>
</tbody>
</table>
| Name | Type | Description |
| -------- | --------------- | ---------------------------------------- |
| data | Object/Function | Data model of the page. If the attribute is of the function type, the return value must be of the object type. The attribute name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (**for**, **if**, **show**, and **tid**).<br>Do not use this attribute and **private** or **public** at the same time.(Rich) |
| props | Array/Object | Used for communication between components. This attribute can be transferred to components via **\<tag xxxx='value'>**. A **props** name must be in lowercase and cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words (**for**, **if**, **show**, and **tid**). Currently, **props** does not support functions.|
| computed | Object | Used for pre-processing an object for reading and setting. The result is cached. The name cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words.|
# grid-col<a name="EN-US_TOPIC_0000001237760449"></a> # grid-col
The **<grid-col\>** is the child component of the **<grid-row\>** container. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<grid-col>** is the child component of the **\<grid-row>** container.
None. ## Required Permissions
## Child Components<a name="section9288143101012"></a> None
## Child Components
Supported Supported
## Attributes<a name="section1976213199113"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
<a name="table20633101642315"></a> In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.449999999999999%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.83%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row61510615123"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p13694117171213"><a name="p13694117171213"></a><a name="p13694117171213"></a>xs</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p17694191719123"><a name="p17694191719123"></a><a name="p17694191719123"></a>number|object</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9694171712125"><a name="p9694171712125"></a><a name="p9694171712125"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p769441711125"><a name="p769441711125"></a><a name="p769441711125"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p3694217141213"><a name="p3694217141213"></a><a name="p3694217141213"></a>Number of columns occupied by this item and offset columns when <strong id="b2585202119227"><a name="b2585202119227"></a><a name="b2585202119227"></a>sizetype</strong> is <strong id="b145851221182211"><a name="b145851221182211"></a><a name="b145851221182211"></a>xs</strong>. If you set the value of the number type, you only set the number of occupied columns. You can set a value of the object type for both the number of occupied columns and offset columns, for example, <strong id="b1058552182220"><a name="b1058552182220"></a><a name="b1058552182220"></a>{"span": 1, "offset": 0}</strong>.</p>
</td>
</tr>
<tr id="row683183131212"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p15694417181219"><a name="p15694417181219"></a><a name="p15694417181219"></a>sm</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p15694141741210"><a name="p15694141741210"></a><a name="p15694141741210"></a>number|object</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p66941517171212"><a name="p66941517171212"></a><a name="p66941517171212"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p4694111714123"><a name="p4694111714123"></a><a name="p4694111714123"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p17694117171211"><a name="p17694117171211"></a><a name="p17694117171211"></a>Number of columns occupied by this item and offset columns when <strong id="b57340307222"><a name="b57340307222"></a><a name="b57340307222"></a>sizetype</strong> is <strong id="b6735103052215"><a name="b6735103052215"></a><a name="b6735103052215"></a>sm</strong>. If you set the value of the number type, you only set the number of occupied columns. You can set a value of the object type for both the number of occupied columns and offset columns, for example, <strong id="b473510307229"><a name="b473510307229"></a><a name="b473510307229"></a>{"span": 1, "offset": 0}</strong>.</p>
</td>
</tr>
<tr id="row1211310592118"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p4694161710123"><a name="p4694161710123"></a><a name="p4694161710123"></a>md</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p569551751220"><a name="p569551751220"></a><a name="p569551751220"></a>number|object</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p86952172121"><a name="p86952172121"></a><a name="p86952172121"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p3695171711214"><a name="p3695171711214"></a><a name="p3695171711214"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p66953176126"><a name="p66953176126"></a><a name="p66953176126"></a>Number of columns occupied by this item and offset columns when <strong id="b103393393221"><a name="b103393393221"></a><a name="b103393393221"></a>sizetype</strong> is <strong id="b43391139202219"><a name="b43391139202219"></a><a name="b43391139202219"></a>md</strong>. If you set the value of the number type, you only set the number of occupied columns. You can set a value of the object type for both the number of occupied columns and offset columns, for example, <strong id="b734019398229"><a name="b734019398229"></a><a name="b734019398229"></a>{"span": 1, "offset": 0}</strong>.</p>
</td>
</tr>
<tr id="row9263155681117"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p10695101717122"><a name="p10695101717122"></a><a name="p10695101717122"></a>lg</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p5695131701217"><a name="p5695131701217"></a><a name="p5695131701217"></a>number|object</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1469501714124"><a name="p1469501714124"></a><a name="p1469501714124"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p1769511715127"><a name="p1769511715127"></a><a name="p1769511715127"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p8695111741217"><a name="p8695111741217"></a><a name="p8695111741217"></a>Number of columns occupied by this item and offset columns when <strong id="b689794313225"><a name="b689794313225"></a><a name="b689794313225"></a>sizetype</strong> is <strong id="b2897194312222"><a name="b2897194312222"></a><a name="b2897194312222"></a>lg</strong>. If you set the value of the number type, you only set the number of occupied columns. You can set a value of the object type for both the number of occupied columns and offset columns, for example, <strong id="b189715439226"><a name="b189715439226"></a><a name="b189715439226"></a>{"span": 1, "offset": 0}</strong>.</p>
</td>
</tr>
<tr id="row1236753141115"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p166957175127"><a name="p166957175127"></a><a name="p166957175127"></a>span</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1569561741210"><a name="p1569561741210"></a><a name="p1569561741210"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p17695201719121"><a name="p17695201719121"></a><a name="p17695201719121"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p156951617101214"><a name="p156951617101214"></a><a name="p156951617101214"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p1169581712121"><a name="p1169581712121"></a><a name="p1169581712121"></a>Default number of columns occupied by this item when no breakpoint is set.</p>
</td>
</tr>
<tr id="row1348115011117"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p12695141741216"><a name="p12695141741216"></a><a name="p12695141741216"></a>offset</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p0695131711124"><a name="p0695131711124"></a><a name="p0695131711124"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p8695111710129"><a name="p8695111710129"></a><a name="p8695111710129"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.449999999999999%" headers="mcps1.1.6.1.4 "><p id="p15695111781220"><a name="p15695111781220"></a><a name="p15695111781220"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.83%" headers="mcps1.1.6.1.5 "><p id="p2069531710128"><a name="p2069531710128"></a><a name="p2069531710128"></a>Default number of offset columns in the container layout direction when <strong id="b19705495222"><a name="b19705495222"></a><a name="b19705495222"></a>"offset"</strong> is not set for a specific <strong id="b8970349172212"><a name="b8970349172212"></a><a name="b8970349172212"></a>sizetype</strong>.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section1948816404128"></a> | Name | Type | Default Value | Mandatory | Description |
| ------ | -------------- | ---- | ---- | ---------------------------------------- |
| xs | number\|object | - | No | Number of columns occupied by this item and its offset when **sizetype** is **xs**. If you set the value of the number type, you only set the number of columns. You can set a value of the object type for both the number of occupied columns and the offset, for example, **{"span": 1, "offset": 0}**. |
| sm | number\|object | - | No | Number of columns occupied by this item and its offset when **sizetype** is **sm**. If you set the value of the number type, you only set the number of columns. You can set a value of the object type for both the number of occupied columns and the offset, for example, **{"span": 1, "offset": 0}**. |
| md | number\|object | - | No | Number of columns occupied by this item and its offset when **sizetype** is **md**. If you set the value of the number type, you only set the number of columns. You can set a value of the object type for both the number of occupied columns and the offset, for example, **{"span": 1, "offset": 0}**. |
| lg | number\|object | - | No | Number of columns occupied by this item and its offset when **sizetype** is **lg**. If you set the value of the number type, you only set the number of columns. You can set a value of the object type for both the number of occupied columns and the offset, for example, **{"span": 1, "offset": 0}**. |
| span | number | 1 | No | Default number of columns occupied by the item when no breakpoint is set. |
| offset | number | 0 | No | Default number of offset columns in the container layout direction when **"offset"** is not set for a specific **sizetype**. |
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table282005513017"></a> ## Styles
<table><thead align="left"><tr id="row168201855113012"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p38201055113016"><a name="p38201055113016"></a><a name="p38201055113016"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.218778122187782%" id="mcps1.1.6.1.2"><p id="p3820105573010"><a name="p3820105573010"></a><a name="p3820105573010"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13.03869613038696%" id="mcps1.1.6.1.3"><p id="p1282065593020"><a name="p1282065593020"></a><a name="p1282065593020"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="8.4991500849915%" id="mcps1.1.6.1.4"><p id="p2820455103013"><a name="p2820455103013"></a><a name="p2820455103013"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="43.12568743125688%" id="mcps1.1.6.1.5"><p id="p8820115573010"><a name="p8820115573010"></a><a name="p8820115573010"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row482195519300"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p108211555183011"><a name="p108211555183011"></a><a name="p108211555183011"></a>flex-direction</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p6821185583020"><a name="p6821185583020"></a><a name="p6821185583020"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p108217558305"><a name="p108217558305"></a><a name="p108217558305"></a>row</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p168211655173015"><a name="p168211655173015"></a><a name="p168211655173015"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p18821165563017"><a name="p18821165563017"></a><a name="p18821165563017"></a>Main axis direction of the container. Available values are as follows:</p>
<a name="ul15821145583019"></a><a name="ul15821145583019"></a><ul id="ul15821145583019"><li><strong id="b139844122235"><a name="b139844122235"></a><a name="b139844122235"></a>column</strong>: Items are placed vertically from top to bottom.</li><li><strong id="b13943201572311"><a name="b13943201572311"></a><a name="b13943201572311"></a>row</strong>: Items are placed horizontally from left to right.</li></ul>
</td>
</tr>
<tr id="row1582115513018"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p148211055133015"><a name="p148211055133015"></a><a name="p148211055133015"></a>flex-wrap</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p0821055103010"><a name="p0821055103010"></a><a name="p0821055103010"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p118212557306"><a name="p118212557306"></a><a name="p118212557306"></a>nowrap</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p168211155143015"><a name="p168211155143015"></a><a name="p168211155143015"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p1382145510309"><a name="p1382145510309"></a><a name="p1382145510309"></a>Whether items in the container are displayed in a single axis or multiple axes. Currently, dynamic modification is not supported. Available values are as follows:</p>
<a name="ul282175510308"></a><a name="ul282175510308"></a><ul id="ul282175510308"><li><strong id="b6139102416233"><a name="b6139102416233"></a><a name="b6139102416233"></a>nowrap</strong>: Items are displayed on a single axis.</li><li><strong id="b2067817262239"><a name="b2067817262239"></a><a name="b2067817262239"></a>wrap</strong>: Items are displayed on multiple axes.</li></ul>
</td>
</tr>
<tr id="row782155583013"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1782175512303"><a name="p1782175512303"></a><a name="p1782175512303"></a>justify-content</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p88219557300"><a name="p88219557300"></a><a name="p88219557300"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p18821855173011"><a name="p18821855173011"></a><a name="p18821855173011"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p3821205517302"><a name="p3821205517302"></a><a name="p3821205517302"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p68219555307"><a name="p68219555307"></a><a name="p68219555307"></a>How items are aligned along the main axis of the current row in the container. Available values are as follows:</p>
<a name="ul782165511302"></a><a name="ul782165511302"></a><ul id="ul782165511302"><li><strong id="b8769731192316"><a name="b8769731192316"></a><a name="b8769731192316"></a>flex-start</strong>: Items are packed towards the start row.</li><li><strong id="b771073314238"><a name="b771073314238"></a><a name="b771073314238"></a>flex-end</strong>: Items are packed towards the end row.</li><li><strong id="b1011423512317"><a name="b1011423512317"></a><a name="b1011423512317"></a>center</strong>: Items are centered along the row.</li><li><strong id="b3987391242"><a name="b3987391242"></a><a name="b3987391242"></a>space-between</strong>: Items are positioned with space between the rows.</li><li><strong id="b357091132411"><a name="b357091132411"></a><a name="b357091132411"></a>space-around</strong>: Items are positioned with space before, between, and after the rows.</li></ul>
</td>
</tr>
<tr id="row182215556305"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p13822205523020"><a name="p13822205523020"></a><a name="p13822205523020"></a>align-items</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p6822155519300"><a name="p6822155519300"></a><a name="p6822155519300"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p1982215523014"><a name="p1982215523014"></a><a name="p1982215523014"></a>stretch</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p14822655113020"><a name="p14822655113020"></a><a name="p14822655113020"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p17822555103011"><a name="p17822555103011"></a><a name="p17822555103011"></a>How items are aligned along the cross axis of the current row in the container. Available values are as follows:</p>
<a name="ul1822185512309"></a><a name="ul1822185512309"></a><ul id="ul1822185512309"><li><strong id="b16113143415242"><a name="b16113143415242"></a><a name="b16113143415242"></a>stretch</strong>: Items are stretched to the same height or width as the container in the cross axis direction. </li><li><strong id="b20396146112419"><a name="b20396146112419"></a><a name="b20396146112419"></a>flex-start</strong>: Items are aligned to the start of the cross axis.</li><li><strong id="b892674722417"><a name="b892674722417"></a><a name="b892674722417"></a>flex-end</strong>: Items are aligned to the end of the cross axis.</li><li><strong id="b31272211257"><a name="b31272211257"></a><a name="b31272211257"></a>center</strong>: Items are aligned in the middle of the cross axis.</li></ul>
</td>
</tr>
<tr id="row158231551309"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p108231055173010"><a name="p108231055173010"></a><a name="p108231055173010"></a>align-content</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p98231455193012"><a name="p98231455193012"></a><a name="p98231455193012"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p108232055103011"><a name="p108232055103011"></a><a name="p108232055103011"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p198231155153019"><a name="p198231155153019"></a><a name="p198231155153019"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p1882312558307"><a name="p1882312558307"></a><a name="p1882312558307"></a>Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:</p>
<a name="ul282335519305"></a><a name="ul282335519305"></a><ul id="ul282335519305"><li><strong id="b9493718162518"><a name="b9493718162518"></a><a name="b9493718162518"></a>flex-start</strong>: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b11505192419253"><a name="b11505192419253"></a><a name="b11505192419253"></a>flex-end</strong>: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b188881131152510"><a name="b188881131152510"></a><a name="b188881131152510"></a>center</strong>: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start of the container's cross axis and the first row is equal to the spacing between the end of the container's cross axis and the last row.</li><li><strong id="b15345336172513"><a name="b15345336172513"></a><a name="b15345336172513"></a>space-between</strong>: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.</li><li><strong id="b83081740202520"><a name="b83081740202520"></a><a name="b83081740202520"></a>space-around</strong>: All rows are evenly distributed in the container, and the spacing between two adjacent lines is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.</li></ul>
</td>
</tr>
<tr id="row782325510307"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p5823355143013"><a name="p5823355143013"></a><a name="p5823355143013"></a>display</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p582325563018"><a name="p582325563018"></a><a name="p582325563018"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p68238557307"><a name="p68238557307"></a><a name="p68238557307"></a>flex</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p182315511303"><a name="p182315511303"></a><a name="p182315511303"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p1482375503018"><a name="p1482375503018"></a><a name="p1482375503018"></a>Type of the view box of the element. Currently, dynamic modification is not supported. Available values are as follows:</p>
<a name="ul6823155153010"></a><a name="ul6823155153010"></a><ul id="ul6823155153010"><li><strong id="b3449378266"><a name="b3449378266"></a><a name="b3449378266"></a>flex</strong>: flexible layout.</li><li><strong id="b1765823342610"><a name="b1765823342610"></a><a name="b1765823342610"></a>grid</strong>: grid layout.</li><li><strong id="b1626853618271"><a name="b1626853618271"></a><a name="b1626853618271"></a>none</strong>: disabled.</li></ul>
</td>
</tr>
<tr id="row382411557307"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p48249553303"><a name="p48249553303"></a><a name="p48249553303"></a>grid-template-[columns|rows]</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p0824115563014"><a name="p0824115563014"></a><a name="p0824115563014"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p7824185512308"><a name="p7824185512308"></a><a name="p7824185512308"></a>1 row, 1 column</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p782445523018"><a name="p782445523018"></a><a name="p782445523018"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p1082465513013"><a name="p1082465513013"></a><a name="p1082465513013"></a>Number of rows and columns in the current grid layout. If this attribute is not set, one row and one column are displayed by default. This attribute is valid only when <strong id="b28621856183616"><a name="b28621856183616"></a><a name="b28621856183616"></a>display</strong> is set to <strong id="b3863156133617"><a name="b3863156133617"></a><a name="b3863156133617"></a>grid</strong>.</p>
<p id="p18824145520305"><a name="p18824145520305"></a><a name="p18824145520305"></a>For example, set <strong id="b4153173193711"><a name="b4153173193711"></a><a name="b4153173193711"></a>grid-template-columns</strong> to:</p>
<p id="p68241557304"><a name="p68241557304"></a><a name="p68241557304"></a>(1) <strong id="b846617113713"><a name="b846617113713"></a><a name="b846617113713"></a>50px 100px 60px</strong>: There are three columns. The first column is 50 px, the second column is 100 px, and the third column is 60 px.</p>
<p id="p4824105513305"><a name="p4824105513305"></a><a name="p4824105513305"></a>(2) <strong id="b1647513243379"><a name="b1647513243379"></a><a name="b1647513243379"></a>1fr 1fr 2fr</strong>: There are three columns, and the width allowed by the parent component is divided into four equal shares. The first column occupies one share, the second column occupies one share, and the third column occupies two shares.</p>
<p id="p128242055163011"><a name="p128242055163011"></a><a name="p128242055163011"></a>(3) <strong id="b726082719376"><a name="b726082719376"></a><a name="b726082719376"></a>30% 20% 50%</strong>: There are three columns. The first column occupies 30% of the total width allowed by the parent component, the second column occupies 20%, and the third column occupies 50%.</p>
<p id="p282475514306"><a name="p282475514306"></a><a name="p282475514306"></a>(4) <strong id="b7978142816374"><a name="b7978142816374"></a><a name="b7978142816374"></a>repeat (2,100px)</strong>: There are two columns. The first column is 100 px, and the second column is 100 px.</p>
<p id="p17824185516300"><a name="p17824185516300"></a><a name="p17824185516300"></a>(5) <strong id="b109141030143716"><a name="b109141030143716"></a><a name="b109141030143716"></a>auto 1fr 1fr</strong>: There are three columns. The first column is adaptive to the width required by its child components. The remaining space is divided into two equal shares, one share occupied by each of the two columns.</p>
</td>
</tr>
<tr id="row1882465518305"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p28241855183010"><a name="p28241855183010"></a><a name="p28241855183010"></a>grid-[columns|rows]-gap</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p6824755103014"><a name="p6824755103014"></a><a name="p6824755103014"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p1282455553014"><a name="p1282455553014"></a><a name="p1282455553014"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p1824125515309"><a name="p1824125515309"></a><a name="p1824125515309"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p88241255183013"><a name="p88241255183013"></a><a name="p88241255183013"></a>Size of the gap between two consecutive rows or columns in a grid layout. You can also use <strong id="b6959203393714"><a name="b6959203393714"></a><a name="b6959203393714"></a>grid-gap</strong> to set the same size of the gap between rows and columns. This attribute is valid only when <strong id="b796033313718"><a name="b796033313718"></a><a name="b796033313718"></a>display</strong> is set to <strong id="b69601833153714"><a name="b69601833153714"></a><a name="b69601833153714"></a>grid</strong>.</p>
</td>
</tr>
<tr id="row10824135523013"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p882475513307"><a name="p882475513307"></a><a name="p882475513307"></a>grid-row-[start|end]</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p19824205513018"><a name="p19824205513018"></a><a name="p19824205513018"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p7824105523012"><a name="p7824105523012"></a><a name="p7824105523012"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p782445503011"><a name="p782445503011"></a><a name="p782445503011"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p13824115519302"><a name="p13824115519302"></a><a name="p13824115519302"></a>Start and end row numbers of the current item in the grid layout. This attribute is valid only when <strong id="b887337113714"><a name="b887337113714"></a><a name="b887337113714"></a>display</strong> of the parent component is <strong id="b1487437153717"><a name="b1487437153717"></a><a name="b1487437153717"></a>grid</strong>. (The <strong id="b0879377371"><a name="b0879377371"></a><a name="b0879377371"></a>display</strong> attribute of the parent component can be set to <strong id="b16871537163710"><a name="b16871537163710"></a><a name="b16871537163710"></a>grid</strong> only for the <strong id="b198853711373"><a name="b198853711373"></a><a name="b198853711373"></a>&lt;div&gt;</strong> container.)</p>
</td>
</tr>
<tr id="row1582495513010"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p48247556301"><a name="p48247556301"></a><a name="p48247556301"></a>grid-column-[start|end]</p>
</td>
<td class="cellrowborder" valign="top" width="12.218778122187782%" headers="mcps1.1.6.1.2 "><p id="p2825455183011"><a name="p2825455183011"></a><a name="p2825455183011"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="13.03869613038696%" headers="mcps1.1.6.1.3 "><p id="p1382545583012"><a name="p1382545583012"></a><a name="p1382545583012"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="8.4991500849915%" headers="mcps1.1.6.1.4 "><p id="p382515553016"><a name="p382515553016"></a><a name="p382515553016"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.12568743125688%" headers="mcps1.1.6.1.5 "><p id="p128256553309"><a name="p128256553309"></a><a name="p128256553309"></a>Start and end column numbers of the current item in the grid layout. This attribute is valid only when <strong id="b8311144193712"><a name="b8311144193712"></a><a name="b8311144193712"></a>display</strong> of the parent component is <strong id="b43111041183711"><a name="b43111041183711"></a><a name="b43111041183711"></a>grid</strong>. (The <strong id="b1331120417371"><a name="b1331120417371"></a><a name="b1331120417371"></a>display</strong> attribute of the parent component can be set to <strong id="b731164115376"><a name="b731164115376"></a><a name="b731164115376"></a>grid</strong> only for the <strong id="b131284183717"><a name="b131284183717"></a><a name="b131284183717"></a>&lt;div&gt;</strong> container.)</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:** In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
>Width-related styles are not supported.
## Events<a name="section94351031102113"></a> | Name | Type | Default Value | Mandatory | Description |
| ----------------------------- | -------------- | ---------- | ---- | ---------------------------------------- |
| flex-direction | string | row | No | Main axis direction of the flex container, which defines how items are placed in the container. Available values are as follows:<br>- **column**: Items are placed vertically from top to bottom.<br>- **row**: Items are placed horizontally from left to right.|
| flex-wrap | string | nowrap | No | Whether items in the flex container are displayed in a single line or multiple lines. The value cannot be dynamically updated. Available values are as follows:<br>- **nowrap**: Items are displayed on a single axis.<br>- **wrap**: Items are displayed on multiple axes.|
| justify-content | string | flex-start | No | How items are aligned along the main axis of the flex container. Available values are as follows:<br>- **flex-start**: Items are packed towards the start row.<br>- **flex-end**: Items are packed towards the end row.<br>- **center**: Items are centered along the row.<br>- **space-between**: Items are positioned with space between the rows.<br>- **space-around**: Items are positioned with space before, between, and after the rows.|
| align-items | string | stretch | No | How items are aligned along the cross axis in a flex container. Available values are as follows:<br>- **stretch**: Items are stretched to the same height or width as the container in the cross axis direction.<br>- **flex-start**: Items are aligned to the start of the cross axis.<br>- **flex-end**: Items are aligned to the end of the cross axis.<br>- **center**: Items are aligned in the center of the cross axis.|
| align-content | string | flex-start | No | Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:<br>- **flex-start**: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **flex-end**: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **center**: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start edge of the container's cross axis and the first row is equal to the spacing between the end edge of the container's cross axis and the last row.<br>- **space-between**: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.<br>- **space-around**: All rows are evenly distributed in the container, and the spacing between two adjacent lines is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.|
| display | string | flex | No | Type of the view box of the item. The value cannot be dynamically updated. Available values are as follows:<br>- **flex**: flexible layout.<br>- **grid**: grid layout.<br>- **none**: The box is disabled.|
| grid-template-[columns\|rows] | string | 1 row, 1 column | No | Number of rows and columns in the current grid layout. If this attribute is not set, one row and one column are displayed by default. This attribute is valid only when **display** is set to **grid**.<br>Below are some example values of **grid-template-columns**:<br>- **50px 100px 60px**: There are three columns. The first column is 50 px, the second column is 100 px, and the third column is 60 px.<br>- **1fr 1fr 2fr**: There are three columns, and the width allowed by the parent component is divided into four equal shares. The first column occupies one share, the second column occupies one share, and the third column occupies two shares.<br>- **30% 20% 50%**: There are three columns. The first column occupies 30% of the total width allowed by the parent component, the second column occupies 20%, and the third column occupies 50%.<br>- **repeat (2,100px)**: There are two columns. The first column is 100 px, and the second column is 100 px.<br>- **auto 1fr 1fr**: There are three columns. The first column is adaptive to the width required by its child components. The remaining space is divided into two equal shares, one share occupied by each of the rest two columns.|
| grid-[columns\|rows]-gap | &lt;length&gt; | 0 | No | Size of the gap between two consecutive rows or columns in a grid layout. You can also use **grid-gap** to set the same size of the gap between rows and columns. This attribute is valid only when **display** is set to **grid**.|
| grid-row-[start\|end] | number | - | No | Start and end row numbers of the current item in the grid layout. This attribute is valid only when the item's parent component is a **\<div>** container whose **display** style is set to **grid**.|
| grid-column-[start\|end] | number | - | No | Start and end column numbers of the current item in the grid layout. This attribute is valid only when the item's parent component is a **\<div>** container whose **display** style is set to **grid**.|
Events in [Universal Events](js-components-common-events.md) are supported. > **NOTE**
>
> Width-related styles are not supported.
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported. ## Events
## Example<a name="section2021865273710"></a> The [universal events](../arkui-js/js-components-common-events.md) are supported.
```
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- index.hml --> <!-- index.hml -->
<div class="container"> <div class="container">
<grid-container id="mygrid" columns="5" gutter="20px" style="background-color: pink;"> <grid-container id="mygrid" columns="5" gutter="20px" style="background-color: pink;">
...@@ -271,7 +84,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -271,7 +84,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* index.css */ /* index.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -279,7 +92,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -279,7 +92,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// index.js // index.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -302,5 +115,4 @@ export default { ...@@ -302,5 +115,4 @@ export default {
} }
``` ```
![](figures/grid.gif) ![grid](figures/grid.gif)
# grid-container<a name="EN-US_TOPIC_0000001173324617"></a> # grid-container
The **<grid-container\>** component is the root container of the grid layout. Within the root container, you can use **<grid-row\>** and **<grid-col\>** for the grid layout. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
The **\<grid-container>** component is the root container of the grid layout. Within the root container, you can use **\<grid-row>** and **\<grid-col>** for the grid layout.
## Required Permissions<a name="section11257113618419"></a> ## Required Permissions
None None
## Child Component<a name="section9288143101012"></a>
Only the **<grid-row\>** component is supported. ## Child Components
Only the **\<grid-row>** component is supported.
## Attributes<a name="section5248929161316"></a> ## Attributes
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a> | Name| Type| Default Value| Mandatory| Description|
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p> | -------- | -------- | -------- | -------- | -------- |
</th> | columns | string \| number | auto | No| Total number of columns in the grid. If a value of the string type is set, it can only be **auto**. In this case, the total number of columns is determined based on the current **sizetype**, which can be one of the following values:<br>- **xs**: 2 columns<br>- **sm**: 4 columns<br>- **md**: 8 columns<br>- **lg**: 12 columns|
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p> | sizetype | string | auto | No| Size-responsive type of the grid. Available values are **xs**, **sm**, **md**, and **lg**. If the default value **auto** is used, the framework automatically selects one of the four types based on the current container size.|
</th> | gutter | &lt;length&gt; | 24px | No| Gutter width.|
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p> | gridtemplate<sup>6+</sup> | string | default | No| Layout template of the grid, which defines the columns, gutters, and margins for different size-responsive types. This attribute is available when **columns** and **sizetype** are set to **auto**. For details about the values, see **gridtemplate**.|
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row18693825133018"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p6247162723015"><a name="p6247162723015"></a><a name="p6247162723015"></a>columns</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p824742753016"><a name="p824742753016"></a><a name="p824742753016"></a>string | number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p102474272303"><a name="p102474272303"></a><a name="p102474272303"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p0247112733012"><a name="p0247112733012"></a><a name="p0247112733012"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p224762773015"><a name="p224762773015"></a><a name="p224762773015"></a>Total number of columns in the grid. If a value of the string type is set, it can only be <strong id="b7289163434214"><a name="b7289163434214"></a><a name="b7289163434214"></a>auto</strong>. In this case, the total number of columns is determined based on the current <strong id="b9588131715436"><a name="b9588131715436"></a><a name="b9588131715436"></a>sizetype</strong>, which can be one of the following values:</p>
<a name="ul9387744161011"></a><a name="ul9387744161011"></a><ul id="ul9387744161011"><li><strong id="b2081320274437"><a name="b2081320274437"></a><a name="b2081320274437"></a>xs</strong>: 2 columns</li><li><strong id="b712963416437"><a name="b712963416437"></a><a name="b712963416437"></a>sm</strong>: 4 columns</li><li><strong id="b420975024310"><a name="b420975024310"></a><a name="b420975024310"></a>md</strong>: 8 columns</li><li><strong id="b183281655114316"><a name="b183281655114316"></a><a name="b183281655114316"></a>lg</strong>: 12 columns</li></ul>
</td>
</tr>
<tr id="row2866142283019"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p52471927173014"><a name="p52471927173014"></a><a name="p52471927173014"></a>sizetype</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p92470270304"><a name="p92470270304"></a><a name="p92470270304"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p5247172773018"><a name="p5247172773018"></a><a name="p5247172773018"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p124772703014"><a name="p124772703014"></a><a name="p124772703014"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p7247627163020"><a name="p7247627163020"></a><a name="p7247627163020"></a>Size-responsive type of the grid. Available values are <strong id="b91463252455"><a name="b91463252455"></a><a name="b91463252455"></a>xs</strong>, <strong id="b1714732794517"><a name="b1714732794517"></a><a name="b1714732794517"></a>sm</strong>, <strong id="b15924192884519"><a name="b15924192884519"></a><a name="b15924192884519"></a>md</strong>, and <strong id="b15978430104510"><a name="b15978430104510"></a><a name="b15978430104510"></a>lg</strong>. If the default value <strong id="b101844241462"><a name="b101844241462"></a><a name="b101844241462"></a>auto</strong> is used, the framework automatically selects one of the four types based on the current container size.</p>
</td>
</tr>
<tr id="row275616196304"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p9247122719308"><a name="p9247122719308"></a><a name="p9247122719308"></a>gutter</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1424718278304"><a name="p1424718278304"></a><a name="p1424718278304"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p92471627133011"><a name="p92471627133011"></a><a name="p92471627133011"></a>24px</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p15247202713010"><a name="p15247202713010"></a><a name="p15247202713010"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p16247192714308"><a name="p16247192714308"></a><a name="p16247192714308"></a>Gutter width</p>
</td>
</tr>
<tr id="row164131050102817"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1941415503284"><a name="p1941415503284"></a><a name="p1941415503284"></a>gridtemplate<sup id="sup105523732920"><a name="sup105523732920"></a><a name="sup105523732920"></a>6+</sup></p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p94141850142816"><a name="p94141850142816"></a><a name="p94141850142816"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p34141950172810"><a name="p34141950172810"></a><a name="p34141950172810"></a>default</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p104141550172811"><a name="p104141550172811"></a><a name="p104141550172811"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p5414150172819"><a name="p5414150172819"></a><a name="p5414150172819"></a>Layout template of the grid, which defines the columns, gutters, and margins for different size-responsive types. This attribute is available when <strong id="b1258512715617"><a name="b1258512715617"></a><a name="b1258512715617"></a>columns</strong> and <strong id="b476518131765"><a name="b476518131765"></a><a name="b476518131765"></a>sizetype</strong> are set to <strong id="b148138151263"><a name="b148138151263"></a><a name="b148138151263"></a>auto</strong>. For details about the values, see <a href="#table135645386317">gridtemplate options</a>.</p>
</td>
</tr>
</tbody>
</table>
**Table 1** gridtemplate options<sup>6+</sup> **Table 1** gridtemplate<sup>6+</sup>
<a name="table135645386317"></a> | | Template Value| Size-responsive Type| Columns | Margins (px) | Gutters (px) |
<table><thead align="left"><tr id="row256563853117"><th class="cellrowborder" valign="top" width="11.52769446110778%" id="mcps1.2.7.1.1">&nbsp;&nbsp;</th> | -------- | -------- | -------- | -------- | -------- | -------- |
<th class="cellrowborder" valign="top" width="14.487102579484104%" id="mcps1.2.7.1.2"><p id="p65657386312"><a name="p65657386312"></a><a name="p65657386312"></a>Template Value</p> | Default grid| default | xs | 2 | 12 | 12 |
</th> | | | sm | 4 | 24 | 24 |
<th class="cellrowborder" valign="top" width="18.49630073985203%" id="mcps1.2.7.1.3"><p id="p1956553833119"><a name="p1956553833119"></a><a name="p1956553833119"></a>Size-responsive Type</p> | | | md | 8 | 32 | 24 |
</th> | | | lg | 12 |48|24|
<th class="cellrowborder" valign="top" width="18.49630073985203%" id="mcps1.2.7.1.4"><p id="p3565103873115"><a name="p3565103873115"></a><a name="p3565103873115"></a>Columns</p> | Grid layout| grid | sm (0 < Device horizontal resolution < 600px)| 4 | 24 | 12 |
</th> | | | md | 8 |32|12|
<th class="cellrowborder" valign="top" width="18.49630073985203%" id="mcps1.2.7.1.5"><p id="p3565438123118"><a name="p3565438123118"></a><a name="p3565438123118"></a>Margins(px)</p> | | | lg | 12 |48|12|
</th>
<th class="cellrowborder" valign="top" width="18.49630073985203%" id="mcps1.2.7.1.6"><p id="p8565193843119"><a name="p8565193843119"></a><a name="p8565193843119"></a>Gutters(px)</p>
</th>
</tr>
</thead>
<tbody><tr id="row35651438163116"><td class="cellrowborder" rowspan="4" valign="top" width="11.52769446110778%" headers="mcps1.2.7.1.1 "><p id="p1070922164816"><a name="p1070922164816"></a><a name="p1070922164816"></a>Default grid</p>
</td>
<td class="cellrowborder" rowspan="4" valign="top" width="14.487102579484104%" headers="mcps1.2.7.1.2 "><p id="p165657381311"><a name="p165657381311"></a><a name="p165657381311"></a>default</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.3 "><p id="p1956518386313"><a name="p1956518386313"></a><a name="p1956518386313"></a>xs</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.4 "><p id="p1156683863116"><a name="p1156683863116"></a><a name="p1156683863116"></a>2</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.5 "><p id="p1156603833110"><a name="p1156603833110"></a><a name="p1156603833110"></a>12</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.6 "><p id="p0566203818310"><a name="p0566203818310"></a><a name="p0566203818310"></a>12</p>
</td>
</tr>
<tr id="row7566133843118"><td class="cellrowborder" valign="top" headers="mcps1.2.7.1.1 "><p id="p456615380314"><a name="p456615380314"></a><a name="p456615380314"></a>sm</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.2 "><p id="p2566103818314"><a name="p2566103818314"></a><a name="p2566103818314"></a>4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.3 "><p id="p18566123833111"><a name="p18566123833111"></a><a name="p18566123833111"></a>24</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.4 "><p id="p115661438173119"><a name="p115661438173119"></a><a name="p115661438173119"></a>24</p>
</td>
</tr>
<tr id="row1456616389317"><td class="cellrowborder" valign="top" headers="mcps1.2.7.1.1 "><p id="p35661138173117"><a name="p35661138173117"></a><a name="p35661138173117"></a>md</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.2 "><p id="p13566203812311"><a name="p13566203812311"></a><a name="p13566203812311"></a>8</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.3 "><p id="p17566103819319"><a name="p17566103819319"></a><a name="p17566103819319"></a>32</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.4 "><p id="p11566173814316"><a name="p11566173814316"></a><a name="p11566173814316"></a>24</p>
</td>
</tr>
<tr id="row135873533313"><td class="cellrowborder" valign="top" headers="mcps1.2.7.1.1 "><p id="p1558711543319"><a name="p1558711543319"></a><a name="p1558711543319"></a>lg</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.2 "><p id="p185889523318"><a name="p185889523318"></a><a name="p185889523318"></a>12</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.3 "><p id="p1658815513315"><a name="p1658815513315"></a><a name="p1658815513315"></a>48</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.4 "><p id="p145882517336"><a name="p145882517336"></a><a name="p145882517336"></a>24</p>
</td>
</tr>
<tr id="row375535115395"><td class="cellrowborder" rowspan="3" valign="top" width="11.52769446110778%" headers="mcps1.2.7.1.1 "><p id="p84201325134819"><a name="p84201325134819"></a><a name="p84201325134819"></a>Grid layout</p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="14.487102579484104%" headers="mcps1.2.7.1.2 "><p id="p147956315402"><a name="p147956315402"></a><a name="p147956315402"></a>grid</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.3 "><p id="p675625173915"><a name="p675625173915"></a><a name="p675625173915"></a>sm (0 &lt; device horizontal resolution &lt; 600px)</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.4 "><p id="p10756851163916"><a name="p10756851163916"></a><a name="p10756851163916"></a>4</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.5 "><p id="p67561651123914"><a name="p67561651123914"></a><a name="p67561651123914"></a>24</p>
</td>
<td class="cellrowborder" valign="top" width="18.49630073985203%" headers="mcps1.2.7.1.6 "><p id="p4756125119398"><a name="p4756125119398"></a><a name="p4756125119398"></a>12</p>
</td>
</tr>
<tr id="row1796215541391"><td class="cellrowborder" valign="top" headers="mcps1.2.7.1.1 "><p id="p1996235416399"><a name="p1996235416399"></a><a name="p1996235416399"></a>md</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.2 "><p id="p1896285411394"><a name="p1896285411394"></a><a name="p1896285411394"></a>8</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.3 "><p id="p9962185416391"><a name="p9962185416391"></a><a name="p9962185416391"></a>32</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.4 "><p id="p696235412394"><a name="p696235412394"></a><a name="p696235412394"></a>12</p>
</td>
</tr>
<tr id="row12335758203911"><td class="cellrowborder" valign="top" headers="mcps1.2.7.1.1 "><p id="p03359587398"><a name="p03359587398"></a><a name="p03359587398"></a>lg</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.2 "><p id="p2033514589392"><a name="p2033514589392"></a><a name="p2033514589392"></a>12</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.3 "><p id="p23354588392"><a name="p23354588392"></a><a name="p23354588392"></a>48</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.7.1.4 "><p id="p15335358123917"><a name="p15335358123917"></a><a name="p15335358123917"></a>12</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
> >
>- The px unit is applicable when **autoDesignWidth** is set to **true** in the "js" tag. <sup>6+</sup> > The px unit is applicable when **autoDesignWidth** is set to **true** in the "js" tag.<sup>6+</sup>
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
## Styles<a name="section16690243163414"></a> | Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| justify-content | string | flex-start | No| How items are aligned along the main axis of the flex container. Available values are as follows:<br>- **flex-start**: Items are packed towards the start row.<br>- **flex-end**: Items are packed towards the end row.<br>- **center**: Items are centered along the row.<br>- **space-between**: Items are positioned with space between the rows.<br>- **space-around**: Items are positioned with space before, between, and after the rows.|
| align-items | string | stretch | No| How items are aligned along the cross axis in a flex container. Available values are as follows:<br>- **stretch**: Items are stretched to the same height or width as the container in the cross axis direction.<br>- **flex-start**: Items are aligned to the start of the cross axis.<br>- **flex-end**: Items are aligned to the end of the cross axis.<br>- **center**: Items are aligned in the center of the cross axis.|
| align-content | string | flex-start | No| Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:<br>- **flex-start**: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **flex-end**: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **center**: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start edge of the container's cross axis and the first row is equal to the spacing between the end edge of the container's cross axis and the last row.<br>- **space-between**: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.<br>- **space-around**: All rows are evenly distributed in the container, and the spacing between two adjacent lines is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.|
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table1386942213254"></a> ## Events
<table><thead align="left"><tr id="row1886913223255"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p68690228255"><a name="p68690228255"></a><a name="p68690228255"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.80871912808719%" id="mcps1.1.6.1.2"><p id="p14869822112518"><a name="p14869822112518"></a><a name="p14869822112518"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="13.498650134986503%" id="mcps1.1.6.1.3"><p id="p15869192217258"><a name="p15869192217258"></a><a name="p15869192217258"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.56924307569243%" id="mcps1.1.6.1.4"><p id="p1486982212516"><a name="p1486982212516"></a><a name="p1486982212516"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="43.00569943005699%" id="mcps1.1.6.1.5"><p id="p10869722192510"><a name="p10869722192510"></a><a name="p10869722192510"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row7869322142518"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p16869162213256"><a name="p16869162213256"></a><a name="p16869162213256"></a>justify-content</p>
</td>
<td class="cellrowborder" valign="top" width="12.80871912808719%" headers="mcps1.1.6.1.2 "><p id="p1386912214258"><a name="p1386912214258"></a><a name="p1386912214258"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.498650134986503%" headers="mcps1.1.6.1.3 "><p id="p19869172292512"><a name="p19869172292512"></a><a name="p19869172292512"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="7.56924307569243%" headers="mcps1.1.6.1.4 "><p id="p68702022122511"><a name="p68702022122511"></a><a name="p68702022122511"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.00569943005699%" headers="mcps1.1.6.1.5 "><p id="p387092216251"><a name="p387092216251"></a><a name="p387092216251"></a>How items are aligned along the main axis of the current row in the container. Available values are as follows:</p>
<a name="ul10870182213257"></a><a name="ul10870182213257"></a><ul id="ul10870182213257"><li><strong id="b51288404238"><a name="b51288404238"></a><a name="b51288404238"></a>flex-start</strong>: Items are packed towards the start row.</li><li><strong id="b5644141515401"><a name="b5644141515401"></a><a name="b5644141515401"></a>flex-end</strong>: Items are packed towards the end row.</li><li><strong id="b7864161612403"><a name="b7864161612403"></a><a name="b7864161612403"></a>center</strong>: Items are centered along the row.</li><li><strong id="b88480177406"><a name="b88480177406"></a><a name="b88480177406"></a>space-between</strong>: Items are positioned with space between the rows.</li><li><strong id="b18281819184011"><a name="b18281819184011"></a><a name="b18281819184011"></a>space-around</strong>: Items are positioned with space before, between, and after the rows.</li></ul>
</td>
</tr>
<tr id="row15870152282510"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1687032217257"><a name="p1687032217257"></a><a name="p1687032217257"></a>align-items</p>
</td>
<td class="cellrowborder" valign="top" width="12.80871912808719%" headers="mcps1.1.6.1.2 "><p id="p1587032212513"><a name="p1587032212513"></a><a name="p1587032212513"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.498650134986503%" headers="mcps1.1.6.1.3 "><p id="p98701322122512"><a name="p98701322122512"></a><a name="p98701322122512"></a>stretch</p>
</td>
<td class="cellrowborder" valign="top" width="7.56924307569243%" headers="mcps1.1.6.1.4 "><p id="p48701322192515"><a name="p48701322192515"></a><a name="p48701322192515"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.00569943005699%" headers="mcps1.1.6.1.5 "><p id="p68701122112519"><a name="p68701122112519"></a><a name="p68701122112519"></a>How items are aligned along the cross axis of the current row in the container. Available values are as follows:</p>
<a name="ul3870122212514"></a><a name="ul3870122212514"></a><ul id="ul3870122212514"><li><strong id="b15990175016232"><a name="b15990175016232"></a><a name="b15990175016232"></a>stretch</strong>: Items are stretched to the same height or width as the container in the cross axis direction. </li><li><strong id="b524165320338"><a name="b524165320338"></a><a name="b524165320338"></a>flex-start</strong>: Items are aligned to the start of the cross axis.</li><li><strong id="b676224516400"><a name="b676224516400"></a><a name="b676224516400"></a>flex-end</strong>: Items are aligned to the end of the cross axis.</li><li><strong id="b364214812409"><a name="b364214812409"></a><a name="b364214812409"></a>center</strong>: Items are aligned in the middle of the cross axis.</li></ul>
</td>
</tr>
<tr id="row087015224259"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1870722182510"><a name="p1870722182510"></a><a name="p1870722182510"></a>align-content</p>
</td>
<td class="cellrowborder" valign="top" width="12.80871912808719%" headers="mcps1.1.6.1.2 "><p id="p18870122242511"><a name="p18870122242511"></a><a name="p18870122242511"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="13.498650134986503%" headers="mcps1.1.6.1.3 "><p id="p587016227256"><a name="p587016227256"></a><a name="p587016227256"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="7.56924307569243%" headers="mcps1.1.6.1.4 "><p id="p587117228254"><a name="p587117228254"></a><a name="p587117228254"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="43.00569943005699%" headers="mcps1.1.6.1.5 "><p id="p168715228251"><a name="p168715228251"></a><a name="p168715228251"></a>Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:</p>
<a name="ul38718227256"></a><a name="ul38718227256"></a><ul id="ul38718227256"><li><strong id="b6835336414"><a name="b6835336414"></a><a name="b6835336414"></a>flex-start</strong>: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b16351217154115"><a name="b16351217154115"></a><a name="b16351217154115"></a>flex-end</strong>: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b122251326204112"><a name="b122251326204112"></a><a name="b122251326204112"></a>center</strong>: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start of the container's cross axis and the first row is equal to the spacing between the end of the container's cross axis and the last row.</li><li><strong id="b193979315414"><a name="b193979315414"></a><a name="b193979315414"></a>space-between</strong>: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.</li><li><strong id="b1724683484119"><a name="b1724683484119"></a><a name="b1724683484119"></a>space-around</strong>: All rows are evenly distributed in the container, and the spacing between two adjacent rows is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.</li></ul>
</td>
</tr>
</tbody>
</table>
## Events<a name="section291933813509"></a> The [universal events](../arkui-js/js-components-common-events.md) are supported.
Events in [Universal Events](js-components-common-events.md) are supported.
## Method<a name="section13156101584913"></a> ## Methods
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported. In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
<a name="t26fe2ddff8674cc38a3a1ec490b76e2f"></a> | Name| Parameter| Description|
<table><thead align="left"><tr id="r237544a789f74f4599b0688cdb75239a"><th class="cellrowborder" valign="top" width="23%" id="mcps1.1.4.1.1"><p id="a897dc10a0e4e45bc94f02c558c679435"><a name="a897dc10a0e4e45bc94f02c558c679435"></a><a name="a897dc10a0e4e45bc94f02c558c679435"></a>Name</p> | -------- | -------- | -------- |
</th> | getColumns | - | Returns the number of columns in the grid.|
<th class="cellrowborder" valign="top" width="32%" id="mcps1.1.4.1.2"><p id="ac86c6eca347b48e9a749143ecf54f38f"><a name="ac86c6eca347b48e9a749143ecf54f38f"></a><a name="ac86c6eca347b48e9a749143ecf54f38f"></a>Parameter</p> | getColumnWidth | - | Returns the column width of the grid.|
</th> | getGutterWidth | - | Returns the gutter width between columns of the grid.|
<th class="cellrowborder" valign="top" width="45%" id="mcps1.1.4.1.3"><p id="a0050d08b0c5744de88990d92ef35d3b1"><a name="a0050d08b0c5744de88990d92ef35d3b1"></a><a name="a0050d08b0c5744de88990d92ef35d3b1"></a>Description</p> | getSizeType | - | Returns the size-responsive type of the grid container (xs\|sm\|md\|lg).|
</th>
</tr>
</thead>
<tbody><tr id="r08b3c58c981c42a390dc730286c9ce95"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.1.4.1.1 "><p id="p191499655120"><a name="p191499655120"></a><a name="p191499655120"></a>getColumns</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.1.4.1.2 "><p id="p16149146105111"><a name="p16149146105111"></a><a name="p16149146105111"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.4.1.3 "><p id="p51491967515"><a name="p51491967515"></a><a name="p51491967515"></a>Returns the number of columns in the grid.</p>
</td>
</tr>
<tr id="row89901747115010"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.1.4.1.1 "><p id="p121491167519"><a name="p121491167519"></a><a name="p121491167519"></a>getColumnWidth</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.1.4.1.2 "><p id="p514914615113"><a name="p514914615113"></a><a name="p514914615113"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.4.1.3 "><p id="p81491761519"><a name="p81491761519"></a><a name="p81491761519"></a>Returns the column width of the grid.</p>
</td>
</tr>
<tr id="row440095118508"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.1.4.1.1 "><p id="p614919617515"><a name="p614919617515"></a><a name="p614919617515"></a>getGutterWidth</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.1.4.1.2 "><p id="p91498685115"><a name="p91498685115"></a><a name="p91498685115"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.4.1.3 "><p id="p51495615511"><a name="p51495615511"></a><a name="p51495615511"></a>Returns the gutter width between columns of the grid.</p>
</td>
</tr>
<tr id="row1340723513"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.1.4.1.1 "><p id="p31495615517"><a name="p31495615517"></a><a name="p31495615517"></a>getSizeType</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.1.4.1.2 "><p id="p1014956185118"><a name="p1014956185118"></a><a name="p1014956185118"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.1.4.1.3 "><p id="p1414911617515"><a name="p1414911617515"></a><a name="p1414911617515"></a>Returns the size-responsive type of the grid container, which can be <strong id="b1935468442"><a name="b1935468442"></a><a name="b1935468442"></a>xs</strong>, <strong id="b79446104417"><a name="b79446104417"></a><a name="b79446104417"></a>sm</strong>, <strong id="b179546164415"><a name="b179546164415"></a><a name="b179546164415"></a>md</strong>, or <strong id="b910346144414"><a name="b910346144414"></a><a name="b910346144414"></a>lg</strong>.</p>
</td>
</tr>
</tbody>
</table>
## Example Code<a name="section132671420142616"></a>
For details, see [grid-col](js-components-grid-col.md). ## Example
For details, see [Example in grid-col](../arkui-js/js-components-grid-col.md#example).
# grid-row<a name="EN-US_TOPIC_0000001173324663"></a> # grid-row
The **<grid-row\>** component is a container used as a child component of **<grid-container\>**. Each **<grid-col\>** component is arranged horizontally with **flex**-related styles. By default, items in the **<grid-row\>** component are packed towards the start row and aligned to the start of the cross axis. You can set the items to be displayed in multiple axes. > **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<grid-row>** component is a container used as a child component of **\<grid-container>**. Each **\<grid-col>** component is arranged horizontally with **flex**-related styles. By default, items in the **\<grid-row>** component are packed towards the start row and aligned to the start of the cross axis. You can set the items to be displayed in multiple axes.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
Only the **<grid-col\>** component is supported.
## Attributes<a name="section631751545214"></a>
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section9475356165220"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table1583612162713"></a>
<table><thead align="left"><tr id="row148360114276"><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p id="p08361619274"><a name="p08361619274"></a><a name="p08361619274"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p id="p48361812276"><a name="p48361812276"></a><a name="p48361812276"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p id="p198367112715"><a name="p198367112715"></a><a name="p198367112715"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p1183610152710"><a name="p1183610152710"></a><a name="p1183610152710"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p48362162718"><a name="p48362162718"></a><a name="p48362162718"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row17836181102717"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1283681182714"><a name="p1283681182714"></a><a name="p1283681182714"></a>flex-wrap</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p11837111182712"><a name="p11837111182712"></a><a name="p11837111182712"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p1083741172718"><a name="p1083741172718"></a><a name="p1083741172718"></a>nowrap</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p108371218276"><a name="p108371218276"></a><a name="p108371218276"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p883731162713"><a name="p883731162713"></a><a name="p883731162713"></a>Whether items in the container are displayed in a single axis or multiple axes. Currently, dynamic modification is not supported. Available values are as follows:</p>
<a name="ul1583771142719"></a><a name="ul1583771142719"></a><ul id="ul1583771142719"><li><strong id="b1899950182014"><a name="b1899950182014"></a><a name="b1899950182014"></a>nowrap</strong>: Items are displayed on a single axis.</li><li><strong id="b18315182162018"><a name="b18315182162018"></a><a name="b18315182162018"></a>wrap</strong>: Items are displayed on multiple axes.</li></ul>
</td>
</tr>
<tr id="row14837111202712"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p1883781162717"><a name="p1883781162717"></a><a name="p1883781162717"></a>justify-content</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p183731102715"><a name="p183731102715"></a><a name="p183731102715"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p13837111279"><a name="p13837111279"></a><a name="p13837111279"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p13837111162713"><a name="p13837111162713"></a><a name="p13837111162713"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p198371919278"><a name="p198371919278"></a><a name="p198371919278"></a>How items are aligned along the main axis of the current row in the container. Available values are as follows:</p>
<a name="ul20837121152717"></a><a name="ul20837121152717"></a><ul id="ul20837121152717"><li><strong id="b1442428202016"><a name="b1442428202016"></a><a name="b1442428202016"></a>flex-start</strong>: Items are packed towards the start row.</li><li><strong id="b233318913202"><a name="b233318913202"></a><a name="b233318913202"></a>flex-end</strong>: Items are packed towards the end row.</li><li><strong id="b162541410172015"><a name="b162541410172015"></a><a name="b162541410172015"></a>center</strong>: Items are centered along the row.</li><li><strong id="b131513117202"><a name="b131513117202"></a><a name="b131513117202"></a>space-between</strong>: Items are positioned with space between the rows.</li><li><strong id="b1021031292014"><a name="b1021031292014"></a><a name="b1021031292014"></a>space-around</strong>: Items are positioned with space before, between, and after the rows.</li></ul>
</td>
</tr>
<tr id="row188387162714"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p0838913278"><a name="p0838913278"></a><a name="p0838913278"></a>align-items</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p138385114274"><a name="p138385114274"></a><a name="p138385114274"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p983811122713"><a name="p983811122713"></a><a name="p983811122713"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1883812110278"><a name="p1883812110278"></a><a name="p1883812110278"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p983813116271"><a name="p983813116271"></a><a name="p983813116271"></a>How items are aligned along the cross axis of the current row in the container. Available values are as follows:</p>
<a name="ul2838201122714"></a><a name="ul2838201122714"></a><ul id="ul2838201122714"><li><strong id="b52351418182019"><a name="b52351418182019"></a><a name="b52351418182019"></a>stretch</strong>: Items are stretched to the same height or width as the container in the cross axis direction. </li><li><strong id="b19675172015207"><a name="b19675172015207"></a><a name="b19675172015207"></a>flex-start</strong>: Items are aligned to the start of the cross axis.</li><li><strong id="b2654721132018"><a name="b2654721132018"></a><a name="b2654721132018"></a>flex-end</strong>: Items are aligned to the end of the cross axis.</li><li><strong id="b4585102215204"><a name="b4585102215204"></a><a name="b4585102215204"></a>center</strong>: Items are aligned in the middle of the cross axis.</li></ul>
</td>
</tr>
<tr id="row13839918275"><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p id="p88391714276"><a name="p88391714276"></a><a name="p88391714276"></a>align-content</p>
</td>
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p id="p283919116277"><a name="p283919116277"></a><a name="p283919116277"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p id="p18839181182720"><a name="p18839181182720"></a><a name="p18839181182720"></a>flex-start</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1683911142717"><a name="p1683911142717"></a><a name="p1683911142717"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p148392011271"><a name="p148392011271"></a><a name="p148392011271"></a>Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:</p>
<a name="ul15839101102715"></a><a name="ul15839101102715"></a><ul id="ul15839101102715"><li><strong id="b232014272206"><a name="b232014272206"></a><a name="b232014272206"></a>flex-start</strong>: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b034111308204"><a name="b034111308204"></a><a name="b034111308204"></a>flex-end</strong>: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.</li><li><strong id="b58521334203"><a name="b58521334203"></a><a name="b58521334203"></a>center</strong>: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start of the container's cross axis and the first row is equal to the spacing between the end of the container's cross axis and the last row.</li><li><strong id="b126908361201"><a name="b126908361201"></a><a name="b126908361201"></a>space-between</strong>: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.</li><li><strong id="b19242184011208"><a name="b19242184011208"></a><a name="b19242184011208"></a>space-around</strong>: All rows are evenly distributed in the container, and the spacing between two adjacent rows is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.</li></ul>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>Width-related styles are not supported.
## Events<a name="section1417950207"></a>
Events in [Universal Events](js-components-common-events.md) are supported.
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example Code<a name="section634316188515"></a>
For details, see [grid-col](js-components-grid-col.md).
## Child Components
Only the **\<grid-col>** component is supported.
## Attributes
The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| flex-wrap | string | nowrap | No| Whether items in the flex container are displayed in a single line or multiple lines. The value cannot be dynamically updated. Available values are as follows:<br>- **nowrap**: Items are displayed on a single axis.<br>- **wrap**: Items are displayed on multiple axes.|
| justify-content | string | flex-start | No| How items are aligned along the main axis of the flex container. Available values are as follows:<br>- **flex-start**: Items are packed towards the start row.<br>- **flex-end**: Items are packed towards the end row.<br>- **center**: Items are centered along the row.<br>- **space-between**: Items are positioned with space between the rows.<br>- **space-around**: Items are positioned with space before, between, and after the rows.|
| align-items | string | flex-start | No| How items are aligned along the cross axis in a flex container. Available values are as follows:<br>- **stretch**: Items are stretched to the same height or width as the container in the cross axis direction.<br>- **flex-start**: Items are aligned to the start of the cross axis.<br>- **flex-end**: Items are aligned to the end of the cross axis.<br>- **center**: Items are aligned in the center of the cross axis.|
| align-content | string | flex-start | No| Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows:<br>- **flex-start**: All rows are packed towards the start of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **flex-end**: All rows are packed towards the end of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row.<br>- **center**: All rows are packed towards the center of the container. Rows are close to each other and aligned with the center of the container. The spacing between the start edge of the container's cross axis and the first row is equal to the spacing between the end edge of the container's cross axis and the last row.<br>- **space-between**: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively.<br>- **space-around**: All rows are evenly distributed in the container, and the spacing between two adjacent lines is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.|
> **NOTE**
>
> Width-related styles are not supported.
## Events
The [universal events](../arkui-js/js-components-common-events.md) are supported.
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
For details, see [Example in grid-col](../arkui-js/js-components-grid-col.md#example).
# animate # animate
The **<animate\>** component is used to apply animation to an **<svg\>** component.
>![](../../public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
>This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **\<animate>** component is used to apply animation to an **\<svg>** component.
## Required Permissions ## Required Permissions
None None
## Child Components ## Child Components
Not supported Not supported
## Attributes ## Attributes
<a name="table20633101642315"></a> | Name| Type| Default Value| Mandatory| Description|
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aaf1247770b244944bbcc9f28d9a6f00b"><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a>Name</p> | -------- | -------- | -------- | -------- | -------- |
</th> | id | string | - | No| Unique ID of the component.|
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="a6efc3502761f4faf9630e484280f75b6"><a name="a6efc3502761f4faf9630e484280f75b6"></a><a name="a6efc3502761f4faf9630e484280f75b6"></a>Type</p> | attributeName | string | - | No| Name of the component to which the animation is applied.|
</th> | begin | &lt;time&gt; | 0 | No| Delay time of the animation.<br>The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.|
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="a27a37273d9ad47569ddbcb8db985d302"><a name="a27a37273d9ad47569ddbcb8db985d302"></a><a name="a27a37273d9ad47569ddbcb8db985d302"></a>Default Value</p> | dur | &lt;time&gt; | 0 | No| Animation duration. If **dur** is not set, the value of **end**-**begin** is used as the duration. If the value is less than or equal to 0, the animation is not triggered.<br>The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.|
</th> | end | &lt;time&gt; | 0 | No| Duration after which the animation ends. The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.|
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p> | repeatCount | &lt;number \| indefinite&gt; | 1 | No| Number of times the animation is played. The default value is indefinite. You can set the value to **1** to play the animation only once.|
</th> | fill | &lt;freeze \| remove&gt; | remove | No| State when the animation ends.|
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a2ff3361bfd3b420ba4967452d2ddd098"><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a>Description</p> | calcMode | &lt;discrete \| linear \| paced \| spline&gt; | linear | No| Interpolation mode of the animation.<br>**discrete**: The value of **from** directly jumps to the value of **to**.<br>**linear**: linear.<br>**paced**: linear. After this value is set, the values of **keyTimes** and **keyPoints** are invalid.<br>**spline**: user-defined Bessel curve. The spline point is defined in the **keyTimes** attribute, and the control point of each interval is defined by **keySplines**.|
</th> | keyTimes | string | - | No| Start time of the key frame animation. The value ranges from 0 to 1, separated by semicolons (;), for example, **0;0.3;0.8;1**. **keyTimes**, **keySplines**, and **values** are combined to set the key frame animation. The number of **keyTimes** is the same as that of **values**. The number of **keySplines** is the number of **keyTimes** minus 1.|
</tr> | keySplines | string | - | No| A set of Bessel control points associated with **keyTimes**. You can define the Bessel curves for each key frame. The curves are separated by semicolons (;). The format of the two controls in the curve is x1 y1 x2 y2. For example, **0.5 0 0.5 1; 0.5 0 0.5 1;0.5 0 0.5 1**.|
</thead> | by | number | - | No| Relative offset value to add to a specified attribute in the animation. The default value of **from** is the original attribute value.|
<tbody><tr id="row36332165231"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="a83b6dd280109466fb015e64de1ef4df3"><a name="a83b6dd280109466fb015e64de1ef4df3"></a><a name="a83b6dd280109466fb015e64de1ef4df3"></a>id</p> | from | string | - | No| Start value of the attribute to which the animation is applied.<br>If the **values** attribute has been set, the **from** attribute is invalid.|
</td> | to | string | - | No| End value of the attribute to which the animation is applied.<br>If the **values** attribute has been set, the **to** attribute is invalid.|
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="abc38fa2b85854bc687af75eb17a00a4d"><a name="abc38fa2b85854bc687af75eb17a00a4d"></a><a name="abc38fa2b85854bc687af75eb17a00a4d"></a>string</p> | values | string | - | No| Change value of a group of animations. The format is value1;value2;value3.|
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="a8d12e4af905d4743a5ec9cd6018d2972"><a name="a8d12e4af905d4743a5ec9cd6018d2972"></a><a name="a8d12e4af905d4743a5ec9cd6018d2972"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p42461736102118"><a name="p42461736102118"></a><a name="p42461736102118"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="a1a1731af05554f119fa365748f276bb2"><a name="a1a1731af05554f119fa365748f276bb2"></a><a name="a1a1731af05554f119fa365748f276bb2"></a>Unique ID of the component.</p>
</td>
</tr>
<tr id="row13633131616239"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p135984362214"><a name="p135984362214"></a><a name="p135984362214"></a>attributeName</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1759753619211"><a name="p1759753619211"></a><a name="p1759753619211"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p7596736122112"><a name="p7596736122112"></a><a name="p7596736122112"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p17246836142119"><a name="p17246836142119"></a><a name="p17246836142119"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="adbe7ecbee96b4f938b04a4b8d62791bf"><a name="adbe7ecbee96b4f938b04a4b8d62791bf"></a><a name="adbe7ecbee96b4f938b04a4b8d62791bf"></a>Name of the component to which the animation is applied.</p>
</td>
</tr>
<tr id="row10634131610230"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1159543642120"><a name="p1159543642120"></a><a name="p1159543642120"></a>begin</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p6593336132115"><a name="p6593336132115"></a><a name="p6593336132115"></a>&lt;time&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p11592936142117"><a name="p11592936142117"></a><a name="p11592936142117"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1646316754213"><a name="p1646316754213"></a><a name="p1646316754213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p10941922464"><a name="p10941922464"></a><a name="p10941922464"></a>Delay time of the animation.</p>
<p id="p1094114216469"><a name="p1094114216469"></a><a name="p1094114216469"></a>The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.</p>
</td>
</tr>
<tr id="row1634171618236"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19590123611210"><a name="p19590123611210"></a><a name="p19590123611210"></a>dur</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p17686152762312"><a name="p17686152762312"></a><a name="p17686152762312"></a>&lt;time&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p6589163611217"><a name="p6589163611217"></a><a name="p6589163611217"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1624612362219"><a name="p1624612362219"></a><a name="p1624612362219"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1676818505465"><a name="p1676818505465"></a><a name="p1676818505465"></a>Animation duration. If <strong id="b1544660203114"><a name="b1544660203114"></a><a name="b1544660203114"></a>dur</strong> is not set, the value of <strong id="b136951589311"><a name="b136951589311"></a><a name="b136951589311"></a>end</strong>-<strong id="b1444821113311"><a name="b1444821113311"></a><a name="b1444821113311"></a>begin</strong> is used as the duration. If the value is less than or equal to 0, the animation is not triggered.</p>
<p id="p18768125018462"><a name="p18768125018462"></a><a name="p18768125018462"></a>The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.</p>
</td>
</tr>
<tr id="row1259531661611"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1758863619218"><a name="p1758863619218"></a><a name="p1758863619218"></a>end</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3587173632114"><a name="p3587173632114"></a><a name="p3587173632114"></a>&lt;time&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p115867360215"><a name="p115867360215"></a><a name="p115867360215"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1059610169169"><a name="p1059610169169"></a><a name="p1059610169169"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p759484922319"><a name="p759484922319"></a><a name="p759484922319"></a>Duration after which the animation ends. The value can be ms (ms), s (second), or m (minute). The default value is s (second). Other formats are not supported.</p>
</td>
</tr>
<tr id="row11404114510176"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p145859363216"><a name="p145859363216"></a><a name="p145859363216"></a>repeatCount</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1758493620212"><a name="p1758493620212"></a><a name="p1758493620212"></a>&lt;number | indefinite&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1758315366214"><a name="p1758315366214"></a><a name="p1758315366214"></a>1</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p7893010540"><a name="p7893010540"></a><a name="p7893010540"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p759344911237"><a name="p759344911237"></a><a name="p759344911237"></a>Number of times the animation is played. The default value is indefinite. You can set the value to <strong id="b14918201573219"><a name="b14918201573219"></a><a name="b14918201573219"></a>1</strong> to play the animation only once.</p>
</td>
</tr>
<tr id="row75241175410"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p6582123618212"><a name="p6582123618212"></a><a name="p6582123618212"></a>fill</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p65811136102115"><a name="p65811136102115"></a><a name="p65811136102115"></a>&lt;freeze | remove&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1155610362211"><a name="p1155610362211"></a><a name="p1155610362211"></a>remove</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p4724145065420"><a name="p4724145065420"></a><a name="p4724145065420"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p557624915236"><a name="p557624915236"></a><a name="p557624915236"></a>State when the animation ends.</p>
</td>
</tr>
<tr id="row158325589294"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1083214589293"><a name="p1083214589293"></a><a name="p1083214589293"></a>calcMode</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p7832258142920"><a name="p7832258142920"></a><a name="p7832258142920"></a>&lt;discrete | linear | paced | spline&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p12833175812295"><a name="p12833175812295"></a><a name="p12833175812295"></a>linear</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p138331058192911"><a name="p138331058192911"></a><a name="p138331058192911"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p2083395862919"><a name="p2083395862919"></a><a name="p2083395862919"></a>Interpolation mode of the animation.</p>
<p id="p191847533337"><a name="p191847533337"></a><a name="p191847533337"></a><strong id="b8323142113216"><a name="b8323142113216"></a><a name="b8323142113216"></a>discrete</strong>: The value of <strong id="b752455013214"><a name="b752455013214"></a><a name="b752455013214"></a>from</strong> directly jumps to the value of <strong id="b411775643213"><a name="b411775643213"></a><a name="b411775643213"></a>to</strong>.</p>
<p id="p196601957163315"><a name="p196601957163315"></a><a name="p196601957163315"></a><strong id="b97511633317"><a name="b97511633317"></a><a name="b97511633317"></a>linear</strong>: linear.</p>
<p id="p599115247353"><a name="p599115247353"></a><a name="p599115247353"></a><strong id="b125981513183319"><a name="b125981513183319"></a><a name="b125981513183319"></a>paced</strong>: linear. After this value is set, the values of <strong id="b19223130123317"><a name="b19223130123317"></a><a name="b19223130123317"></a>keyTimes</strong> and <strong id="b1386173520336"><a name="b1386173520336"></a><a name="b1386173520336"></a>keyPoints</strong> are invalid.</p>
<p id="p1734674418335"><a name="p1734674418335"></a><a name="p1734674418335"></a><strong id="b136563407338"><a name="b136563407338"></a><a name="b136563407338"></a>spline</strong>: user-defined Bessel curve. The spline point is defined in the <strong id="b3738847163315"><a name="b3738847163315"></a><a name="b3738847163315"></a>keyTimes</strong> attribute, and the control point of each interval is defined by <strong id="b6133175153320"><a name="b6133175153320"></a><a name="b6133175153320"></a>keySplines</strong>.</p>
</td>
</tr>
<tr id="row1021415563011"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1921455183019"><a name="p1921455183019"></a><a name="p1921455183019"></a>keyTimes</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p102145515309"><a name="p102145515309"></a><a name="p102145515309"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p162141751306"><a name="p162141751306"></a><a name="p162141751306"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1621485203020"><a name="p1621485203020"></a><a name="p1621485203020"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p621412519306"><a name="p621412519306"></a><a name="p621412519306"></a>Start time of the key frame animation. The value ranges from 0 to 1, separated by semicolons (;), for example, <strong id="b1375915100341"><a name="b1375915100341"></a><a name="b1375915100341"></a>0;0.3;0.8;1</strong>. <strong id="b196691614123412"><a name="b196691614123412"></a><a name="b196691614123412"></a>keyTimes</strong>, <strong id="b388521518349"><a name="b388521518349"></a><a name="b388521518349"></a>keySplines</strong>, and <strong id="b105861120173419"><a name="b105861120173419"></a><a name="b105861120173419"></a>values</strong> are combined to set the key frame animation. The number of <strong id="b11841122810348"><a name="b11841122810348"></a><a name="b11841122810348"></a>keyTimes</strong> is the same as that of <strong id="b8880193063411"><a name="b8880193063411"></a><a name="b8880193063411"></a>values</strong>. The number of <strong id="b114117381341"><a name="b114117381341"></a><a name="b114117381341"></a>keySplines</strong> is the number of <strong id="b695174110345"><a name="b695174110345"></a><a name="b695174110345"></a>keyTimes</strong> minus 1.</p>
</td>
</tr>
<tr id="row18385173510392"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p738623513914"><a name="p738623513914"></a><a name="p738623513914"></a>keySplines</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p143861535123917"><a name="p143861535123917"></a><a name="p143861535123917"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p20386103533910"><a name="p20386103533910"></a><a name="p20386103533910"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p193861235183917"><a name="p193861235183917"></a><a name="p193861235183917"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p5386113518391"><a name="p5386113518391"></a><a name="p5386113518391"></a>A set of Bessel control points associated with <strong id="b37611449153418"><a name="b37611449153418"></a><a name="b37611449153418"></a>keyTimes</strong>. You can define the Bessel curves for each key frame. The curves are separated by semicolons (;). The format of the two controls in the curve is x1 y1 x2 y2. For example, <strong id="b42741357193520"><a name="b42741357193520"></a><a name="b42741357193520"></a>0.5 0 0.5 1; 0.5 0 0.5 1;0.5 0 0.5 1</strong>.</p>
</td>
</tr>
<tr id="row136799388349"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1472514210595"><a name="p1472514210595"></a><a name="p1472514210595"></a>by</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p272614211599"><a name="p272614211599"></a><a name="p272614211599"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p9726202114595"><a name="p9726202114595"></a><a name="p9726202114595"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p2072682110592"><a name="p2072682110592"></a><a name="p2072682110592"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p772662145916"><a name="p772662145916"></a><a name="p772662145916"></a>Relative offset value to add to a specified attribute in the animation. The default value of <strong id="b1538419278369"><a name="b1538419278369"></a><a name="b1538419278369"></a>from</strong> is the original attribute value.</p>
</td>
</tr>
<tr id="row17371104994019"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p93721649164018"><a name="p93721649164018"></a><a name="p93721649164018"></a>from</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1437294914015"><a name="p1437294914015"></a><a name="p1437294914015"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p05167580429"><a name="p05167580429"></a><a name="p05167580429"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p205161158184210"><a name="p205161158184210"></a><a name="p205161158184210"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p17372184944016"><a name="p17372184944016"></a><a name="p17372184944016"></a>Start value of the attribute to which the animation is applied.</p>
<p id="p18674115684120"><a name="p18674115684120"></a><a name="p18674115684120"></a>If the <strong id="b14993865376"><a name="b14993865376"></a><a name="b14993865376"></a>values</strong> attribute has been set, the <strong id="b663481314372"><a name="b663481314372"></a><a name="b663481314372"></a>from</strong> attribute is invalid.</p>
</td>
</tr>
<tr id="row31035566404"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1910315684017"><a name="p1910315684017"></a><a name="p1910315684017"></a>to</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p71035562408"><a name="p71035562408"></a><a name="p71035562408"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1215689435"><a name="p1215689435"></a><a name="p1215689435"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p2156814315"><a name="p2156814315"></a><a name="p2156814315"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p131031856134010"><a name="p131031856134010"></a><a name="p131031856134010"></a>End value of the attribute to which the animation is applied.</p>
<p id="p3660170134220"><a name="p3660170134220"></a><a name="p3660170134220"></a>If the <strong id="b5960321193718"><a name="b5960321193718"></a><a name="b5960321193718"></a>values</strong> attribute has been set, the <strong id="b159601321193715"><a name="b159601321193715"></a><a name="b159601321193715"></a>to</strong> attribute is invalid.</p>
</td>
</tr>
<tr id="row8777175111408"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1777735117405"><a name="p1777735117405"></a><a name="p1777735117405"></a>values</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1377785119406"><a name="p1377785119406"></a><a name="p1377785119406"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p135001510174320"><a name="p135001510174320"></a><a name="p135001510174320"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p8500151044311"><a name="p8500151044311"></a><a name="p8500151044311"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1277755115407"><a name="p1277755115407"></a><a name="p1277755115407"></a>Change value of a group of animations. The format is value1;value2;value3.</p>
</td>
</tr>
</tbody>
</table>
## Example ## Example
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg width="400" height="400"> <svg width="400" height="400">
...@@ -208,9 +51,11 @@ Not supported ...@@ -208,9 +51,11 @@ Not supported
</div> </div>
``` ```
![](figures/animate-1.gif)
``` ![zh-cn_image_0000001173324703](figures/zh-cn_image_0000001173324703.gif)
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg width="400" height="400"> <svg width="400" height="400">
...@@ -222,9 +67,11 @@ Not supported ...@@ -222,9 +67,11 @@ Not supported
</div> </div>
``` ```
![](figures/1-10.gif)
``` ![zh-cn_image_0000001167662852](figures/zh-cn_image_0000001167662852.gif)
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg width="400" height="400"> <svg width="400" height="400">
...@@ -235,9 +82,11 @@ Not supported ...@@ -235,9 +82,11 @@ Not supported
</div> </div>
``` ```
![](figures/animate-3.gif)
``` ![zh-cn_image_0000001127284938](figures/zh-cn_image_0000001127284938.gif)
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg fill="white" width="600" height="600"> <svg fill="white" width="600" height="600">
...@@ -267,5 +116,5 @@ Not supported ...@@ -267,5 +116,5 @@ Not supported
</div> </div>
``` ```
![](figures/animate-4.gif)
![animate-4](figures/animate-4.gif)
# animateMotion<a name="EN-US_TOPIC_0000001173324621"></a> # animateMotion
The **<animateMotion\>** component is used to define the animation along a path.
>![](../../public_sys-resources/icon-note.gif) **NOTE:** > **NOTE**
>This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. >
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a> The **\<animateMotion>** component is used to define the animation along a path.
None ## Required Permissions
## Child Components<a name="section9288143101012"></a> None.
## Child Components
Not supported Not supported
## Attributes<a name="section2907183951110"></a>
The **animate** attributes \(**values** does not take effect\) and the attributes in the following table are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aaf1247770b244944bbcc9f28d9a6f00b"><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="a6efc3502761f4faf9630e484280f75b6"><a name="a6efc3502761f4faf9630e484280f75b6"></a><a name="a6efc3502761f4faf9630e484280f75b6"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="a27a37273d9ad47569ddbcb8db985d302"><a name="a27a37273d9ad47569ddbcb8db985d302"></a><a name="a27a37273d9ad47569ddbcb8db985d302"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a2ff3361bfd3b420ba4967452d2ddd098"><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row36332165231"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19122124719532"><a name="p19122124719532"></a><a name="p19122124719532"></a>keyPoints</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3121547175310"><a name="p3121547175310"></a><a name="p3121547175310"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p201211474539"><a name="p201211474539"></a><a name="p201211474539"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p151201747195314"><a name="p151201747195314"></a><a name="p151201747195314"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1211954714533"><a name="p1211954714533"></a><a name="p1211954714533"></a>Point position of a group of key frames. The value of each frame is the distance proportion of the object along the path. The function is the same as that of <strong id="b1312051017397"><a name="b1312051017397"></a><a name="b1312051017397"></a>values</strong> in the <strong id="b176954136392"><a name="b176954136392"></a><a name="b176954136392"></a>animate</strong> attribute.</p>
</td>
</tr>
<tr id="row1634171618236"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p311854717535"><a name="p311854717535"></a><a name="p311854717535"></a>path</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p1911864710533"><a name="p1911864710533"></a><a name="p1911864710533"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p31171947115310"><a name="p31171947115310"></a><a name="p31171947115310"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1911624795319"><a name="p1911624795319"></a><a name="p1911624795319"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p21152477539"><a name="p21152477539"></a><a name="p21152477539"></a>Motion path. The syntax is the same as that of the <strong id="b98551329133916"><a name="b98551329133916"></a><a name="b98551329133916"></a>d</strong> attribute of the <strong id="b031838113914"><a name="b031838113914"></a><a name="b031838113914"></a>&lt;path&gt;</strong> component.</p>
</td>
</tr>
<tr id="row88054245713"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p198115428579"><a name="p198115428579"></a><a name="p198115428579"></a>rotate</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p13811242205710"><a name="p13811242205710"></a><a name="p13811242205710"></a>[auto | auto-reverse | &lt;number&gt;]</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1181042175712"><a name="p1181042175712"></a><a name="p1181042175712"></a>auto</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p168174211576"><a name="p168174211576"></a><a name="p168174211576"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p981164295716"><a name="p981164295716"></a><a name="p981164295716"></a>Rotation direction of an animation object.</p>
</td>
</tr>
</tbody>
</table>
## Example<a name="section360556124815"></a>
``` ## Attributes
The **animate** attributes (**values** does not take effect) and the attributes in the following table are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| keyPoints | string | - | Yes| Point position of a group of key frames. The value of each frame is the distance proportion of the object along the path. The function is the same as that of **values** in the **animate** attribute.|
| path | string | - | Yes| Motion path. The syntax is the same as that of the **d** attribute of the **\<path>** component. |
| rotate | [auto \| auto-reverse \| &lt;number&gt;] | auto | No| Rotation direction of an animation object.|
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg fill="white" width="400" height="400"> <svg fill="white" width="400" height="400">
...@@ -90,5 +52,5 @@ The **animate** attributes \(**values** does not take effect\) and the attrib ...@@ -90,5 +52,5 @@ The **animate** attributes \(**values** does not take effect\) and the attrib
</div> </div>
``` ```
![](figures/2-11.gif)
![2-11](figures/2-11.gif)
# animateTransform # animateTransform
The **<animateTransform\>** component is used to apply a transform animation and supports the following components:
<circle\>, <ellipse\>, <line\>, <path\>, <polygon\>, <polyline\>, <rect\>, <text\> > **NOTE**
>**NOTE**
> >
>This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **\<animateTransform>** component is used to apply a transform animation and supports the following components:
&lt;circle&gt;, &lt;ellipse&gt;, &lt;line&gt;, &lt;path&gt;, &lt;polygon&gt;, &lt;polyline&gt;, &lt;rect&gt;, &lt;text&gt;
## Required Permissions ## Required Permissions
None None
## Child Components ## Child Components
Not supported Not supported
## Attributes ## Attributes
The **animate** attributes and the attributes in the following table are supported. The **animate** attributes and the attributes in the following table are supported.
<a name="table20633101642315"></a> | Name| Type| Default Value| Mandatory| Description|
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aaf1247770b244944bbcc9f28d9a6f00b"><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a>Name</p> | -------- | -------- | -------- | -------- | -------- |
</th> | type | [translate \| scale \| rotate \| skewX \| skewY] | - | Yes| Transform animation type.|
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="a6efc3502761f4faf9630e484280f75b6"><a name="a6efc3502761f4faf9630e484280f75b6"></a><a name="a6efc3502761f4faf9630e484280f75b6"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="a27a37273d9ad47569ddbcb8db985d302"><a name="a27a37273d9ad47569ddbcb8db985d302"></a><a name="a27a37273d9ad47569ddbcb8db985d302"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a2ff3361bfd3b420ba4967452d2ddd098"><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a><a name="a2ff3361bfd3b420ba4967452d2ddd098"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row36332165231"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p19122124719532"><a name="p19122124719532"></a><a name="p19122124719532"></a>type</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p3121547175310"><a name="p3121547175310"></a><a name="p3121547175310"></a>[translate | scale | rotate | skewX | skewY]</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p201211474539"><a name="p201211474539"></a><a name="p201211474539"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p151201747195314"><a name="p151201747195314"></a><a name="p151201747195314"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1211954714533"><a name="p1211954714533"></a><a name="p1211954714533"></a>Transform animation type.</p>
</td>
</tr>
</tbody>
</table>
## Example ## Example
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<div class="back_container"> <div class="back_container">
...@@ -90,7 +72,7 @@ The **animate** attributes and the attributes in the following table are suppo ...@@ -90,7 +72,7 @@ The **animate** attributes and the attributes in the following table are suppo
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -108,11 +90,14 @@ The **animate** attributes and the attributes in the following table are suppo ...@@ -108,11 +90,14 @@ The **animate** attributes and the attributes in the following table are suppo
} }
``` ```
![](figures/animate-transform.gif)
![animate-transform](figures/animate-transform.gif)
Animation overlay Animation overlay
```
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<div class="back_container"> <div class="back_container">
...@@ -146,7 +131,8 @@ Animation overlay ...@@ -146,7 +131,8 @@ Animation overlay
</div> </div>
``` ```
```
```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -163,11 +149,14 @@ Animation overlay ...@@ -163,11 +149,14 @@ Animation overlay
} }
``` ```
![](figures/animate-transform2.gif)
Involved component example ![animate-transform2](figures/animate-transform2.gif)
```
Example of involved components
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<div class="back_container"> <div class="back_container">
...@@ -213,7 +202,8 @@ Involved component example ...@@ -213,7 +202,8 @@ Involved component example
</div> </div>
``` ```
```
```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -230,5 +220,5 @@ Involved component example ...@@ -230,5 +220,5 @@ Involved component example
} }
``` ```
![](figures/animate-transform3.gif)
![animate-transform3](figures/animate-transform3.gif)
# OffscreenCanvasRenderingContext2D<a name="EN-US_TOPIC_0000001180864495"></a> # OffscreenCanvasRenderingContext2D
> **NOTE**
>![](../../public_sys-resources/icon-note.gif) **NOTE:** >
>**OffscreenCanvasRenderingContext2D** is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
Use **OffscreenCanvasRenderingContext2D** to draw rectangles, images, and texts on an **OffscreenCanvas**.
Use **OffscreenCanvasRenderingContext2D** to draw rectangles, images, and texts on an **OffscreenCanvas**.
## Attributes<a name="section661391987"></a>
In addition to the attributes that are supported by **CanvasRenderingContext2D**, the following attributes are supported. ## Attributes
<a name="table67211828124016"></a> In addition to the attributes that are supported by **CanvasRenderingContext2D**, the following attributes are supported.
<table><thead align="left"><tr id="row108577289405"><th class="cellrowborder" valign="top" width="22.872287228722872%" id="mcps1.1.4.1.1"><p id="p385742814403"><a name="p385742814403"></a><a name="p385742814403"></a>Name</p>
</th> | Name | Type | Description |
<th class="cellrowborder" valign="top" width="29.352935293529352%" id="mcps1.1.4.1.2"><p id="p19857192816408"><a name="p19857192816408"></a><a name="p19857192816408"></a>Type</p> | ------ | ------ | ---------------------------------------- |
</th> | filter | string | Image filter.<br>Available options are as follows:<br>- **blur**: applies the Gaussian blur for the image.<br>- **brightness**: applies a linear multiplication to the image to make it look brighter or darker.<br>- **contrast**: adjusts the image contrast.<br>- **drop-shadow**: sets a shadow effect for the image.<br>- **grayscale**: converts the image to a grayscale image.<br>- **hue-rotate**: applies hue rotation to the image.<br>- **invert**: inverts the input image.<br>- **opacity**: sets the opacity of the image.<br>- **saturate**: sets the saturation of the image.<br>- **sepia**: converts the image to dark brown. |
<th class="cellrowborder" valign="top" width="47.774777477747776%" id="mcps1.1.4.1.3"><p id="p18573288402"><a name="p18573288402"></a><a name="p18573288402"></a>Description</p>
</th> **Example**
</tr> ```html
</thead> <!-- xxx.hml -->
<tbody><tr id="row85971918336"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p155980933313"><a name="p155980933313"></a><a name="p155980933313"></a>filter</p> <div style="width: 180px; height: 60px;">
</td> <canvas ref="canvasId" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p735764418306"><a name="p735764418306"></a><a name="p735764418306"></a>string</p> </div>
</td> ```
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p1059819912335"><a name="p1059819912335"></a><a name="p1059819912335"></a>Image filter.</p>
<p id="p4505204453214"><a name="p4505204453214"></a><a name="p4505204453214"></a>Available options are as follows:</p> ```js
<a name="ul03421175334"></a><a name="ul03421175334"></a><ul id="ul03421175334"><li><strong id="b1977553414014"><a name="b1977553414014"></a><a name="b1977553414014"></a>blur</strong>: applies the Gaussian blur for the image.</li><li><strong id="b2316102518"><a name="b2316102518"></a><a name="b2316102518"></a>brightness</strong>: applies a linear multiplication to the image to make it look brighter or darker.</li><li><strong id="b133422021012"><a name="b133422021012"></a><a name="b133422021012"></a>contrast</strong>: adjusts the image contrast.</li><li><strong id="b1132513461314"><a name="b1132513461314"></a><a name="b1132513461314"></a>drop-shadow</strong>: sets a shadow effect for the image.</li><li><strong id="b6985195518111"><a name="b6985195518111"></a><a name="b6985195518111"></a>grayscale</strong>: converts the image to a grayscale image.</li><li><strong id="b1225361013210"><a name="b1225361013210"></a><a name="b1225361013210"></a>hue-rotate</strong>: applies hue rotation to the image.</li><li><strong id="b79537247218"><a name="b79537247218"></a><a name="b79537247218"></a>invert</strong>: inverts the input image.</li><li><strong id="b15492312217"><a name="b15492312217"></a><a name="b15492312217"></a>opacity</strong>: opacity of the converted image.</li><li><strong id="b720319540212"><a name="b720319540212"></a><a name="b720319540212"></a>saturate</strong>: saturation of the converted image.</li><li><strong id="b39940155312"><a name="b39940155312"></a><a name="b39940155312"></a>sepia</strong>: converts the image to dark brown.</li></ul> // xxx.js
</td> export default {
</tr> onShow(){
</tbody> var ctx = this.$refs.canvasId.getContext('2d');
</table> var offscreen = new OffscreenCanvas(360, 500);
var offCanvas2 = offscreen.getContext("2d");
- Example var img = new Image();
img.src = 'common/images/flower.jpg';
``` offCanvas2.drawImage(img, 0, 0, 100, 100);
<!-- xxx.hml --> offCanvas2.filter = 'blur(5px)';
<div style="width: 180px; height: 60px;"> offCanvas2.drawImage(img, 100, 0, 100, 100);
<canvas ref="canvasId" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> offCanvas2.filter = 'grayscale(50%)';
``` offCanvas2.drawImage(img, 200, 0, 100, 100);
``` offCanvas2.filter = 'hue-rotate(90deg)';
//xxx.js offCanvas2.drawImage(img, 0, 100, 100, 100);
export default {
onShow(){ offCanvas2.filter = 'invert(100%)';
var ctx = this.$refs.canvasId.getContext('2d'); offCanvas2.drawImage(img, 100, 100, 100, 100);
var offscreen = new OffscreenCanvas(360, 500);
var offCanvas2 = offscreen.getContext("2d"); offCanvas2.filter = 'drop-shadow(8px 8px 10px green)';
var img = new Image(); offCanvas2.drawImage(img, 200, 100, 100, 100);
img.src = 'common/images/flower.jpg';
offCanvas2.drawImage(img, 0, 0, 100, 100); offCanvas2.filter = 'brightness(0.4)';
offCanvas2.filter = 'blur(5px)'; offCanvas2.drawImage(img, 0, 200, 100, 100);
offCanvas2.drawImage(img, 100, 0, 100, 100);
offCanvas2.filter = 'opacity(25%)';
offCanvas2.filter = 'grayscale(50%)'; offCanvas2.drawImage(img, 100, 200, 100, 100);
offCanvas2.drawImage(img, 200, 0, 100, 100);
offCanvas2.filter = 'saturate(30%)';
offCanvas2.filter = 'hue-rotate(90deg)'; offCanvas2.drawImage(img, 200, 200, 100, 100);
offCanvas2.drawImage(img, 0, 100, 100, 100);
offCanvas2.filter = 'sepia(60%)';
offCanvas2.filter = 'invert(100%)'; offCanvas2.drawImage(img, 0, 300, 100, 100);
offCanvas2.drawImage(img, 100, 100, 100, 100);
offCanvas2.filter = 'contrast(200%)';
offCanvas2.filter = 'drop-shadow(8px 8px 10px green)'; offCanvas2.drawImage(img, 100, 300, 100, 100);
offCanvas2.drawImage(img, 200, 100, 100, 100); var bitmap = offscreen.transferToImageBitmap();
ctx.transferFromImageBitmap(bitmap);
offCanvas2.filter = 'brightness(0.4)'; }
offCanvas2.drawImage(img, 0, 200, 100, 100); }
```
offCanvas2.filter = 'opacity(25%)';
offCanvas2.drawImage(img, 100, 200, 100, 100); ## Methods
offCanvas2.filter = 'saturate(30%)'; In addition to the methods that are supported by **CanvasRenderingContext2D**, the following methods are supported.
offCanvas2.drawImage(img, 200, 200, 100, 100);
offCanvas2.filter = 'sepia(60%)'; ### isPointInPath
offCanvas2.drawImage(img, 0, 300, 100, 100);
isPointInPath(path?: Path2D, x: number, y: number): boolean
offCanvas2.filter = 'contrast(200%)';
offCanvas2.drawImage(img, 100, 300, 100, 100);
var bitmap = offscreen.transferToImageBitmap();
ctx.transferFromImageBitmap(bitmap);
}
}
```
## Methods<a name="section47669296127"></a>
In addition to the attributes that are supported by **CanvasRenderingContext2D**, the following attributes are supported.
### isPointInPath<a name="section12576152143713"></a>
isPointInPath\(path?: Path2D, x: number, y: number\): boolean
Checks whether a specified point is in the path area. Checks whether a specified point is in the path area.
- Parameters **Parameters**
| Name | Type | Mandatory | Description |
<a name="table3592161817496"></a> | ---- | ------ | ---- | ----------------------------- |
<table><thead align="left"><tr id="row19592141864916"><th class="cellrowborder" valign="top" width="21.04%" id="mcps1.1.5.1.1"><p id="p229575610288"><a name="p229575610288"></a><a name="p229575610288"></a>Name</p> | path | Path2D | No | Path used for checking. If this parameter is not set, the current path is used.|
</th> | x | number | Yes | X-coordinate of the point used for checking. |
<th class="cellrowborder" valign="top" width="15.260000000000002%" id="mcps1.1.5.1.2"><p id="p929585682819"><a name="p929585682819"></a><a name="p929585682819"></a>Type</p> | y | number | Yes | Y-coordinate of the point used for checking. |
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="p988715163459"><a name="p988715163459"></a><a name="p988715163459"></a>Mandatory</p> **Return value**
</th> | Type | Description |
<th class="cellrowborder" valign="top" width="56.18%" id="mcps1.1.5.1.4"><p id="p1929645618282"><a name="p1929645618282"></a><a name="p1929645618282"></a>Description</p> | ------- | ------------- |
</th> | boolean | Whether a specified point is in the path area.|
</tr>
</thead> **Example**
<tbody><tr id="row1559261834915"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p115927183493"><a name="p115927183493"></a><a name="p115927183493"></a>path</p> ```html
</td> <!-- xxx.hml -->
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p95921918114914"><a name="p95921918114914"></a><a name="p95921918114914"></a>Path2D</p> <div style="width: 180px; height: 60px;">
</td> <text>In path:{{textValue}}</text>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p1188716161453"><a name="p1188716161453"></a><a name="p1188716161453"></a>No</p> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</td> </div>
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p168291512124013"><a name="p168291512124013"></a><a name="p168291512124013"></a>Path used for checking. If this parameter is not set, the current path is used.</p> ```
</td>
</tr> ```js
<tr id="row195921118184916"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p1622015388394"><a name="p1622015388394"></a><a name="p1622015388394"></a>x</p> // xxx.js
</td> export default {
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p1635295333919"><a name="p1635295333919"></a><a name="p1635295333919"></a>number</p> data: {
</td> textValue: 0
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p17887616174515"><a name="p17887616174515"></a><a name="p17887616174515"></a>Yes</p> },
</td> onShow(){
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p6592518124911"><a name="p6592518124911"></a><a name="p6592518124911"></a>X-coordinate of the point used for checking.</p> var canvas = this.$refs.canvas.getContext('2d');
</td> var offscreen = new OffscreenCanvas(500,500);
</tr> var offscreenCanvasCtx = offscreen.getContext("2d");
<tr id="row449114413392"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p1349212448390"><a name="p1349212448390"></a><a name="p1349212448390"></a>y</p>
</td> offscreenCanvasCtx.rect(10, 10, 100, 100);
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p44927443396"><a name="p44927443396"></a><a name="p44927443396"></a>number</p> offscreenCanvasCtx.fill();
</td> this.textValue = offscreenCanvasCtx.isPointInPath(30, 70);
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p18888101694519"><a name="p18888101694519"></a><a name="p18888101694519"></a>Yes</p>
</td> var bitmap = offscreen.transferToImageBitmap();
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p79061374406"><a name="p79061374406"></a><a name="p79061374406"></a>Y-coordinate of the point used for checking.</p> canvas.transferFromImageBitmap(bitmap);
</td> }
</tr> }
</tbody> ```
</table>
![en-us_image_0000001224354967](figures/en-us_image_0000001224354967.png)
- Return values
### isPointInStroke
<a name="table0782932202818"></a>
<table><thead align="left"><tr id="row3782832172814"><th class="cellrowborder" valign="top" width="19.77%" id="mcps1.1.3.1.1"><p id="p1278314323284"><a name="p1278314323284"></a><a name="p1278314323284"></a>Type</p> isPointInStroke(path?: Path2D, x: number, y: number): boolean
</th>
<th class="cellrowborder" valign="top" width="80.23%" id="mcps1.1.3.1.2"><p id="p17783153216281"><a name="p17783153216281"></a><a name="p17783153216281"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row278317321285"><td class="cellrowborder" valign="top" width="19.77%" headers="mcps1.1.3.1.1 "><p id="p98384418408"><a name="p98384418408"></a><a name="p98384418408"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="80.23%" headers="mcps1.1.3.1.2 "><p id="p1537310444489"><a name="p1537310444489"></a><a name="p1537310444489"></a>Whether a specified point is in the path area.</p>
</td>
</tr>
</tbody>
</table>
- Example
```
<!-- xxx.hml -->
<div style="width: 180px; height: 60px;">
<text>In path:{{textValue}}</text>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div>
```
```
// xxx.js
export default {
data: {
textValue: 0
},
onShow(){
var canvas = this.$refs.canvas.getContext('2d');
var offscreen = new OffscreenCanvas(500,500);
var offscreenCanvasCtx = offscreen.getContext("2d");
offscreenCanvasCtx.rect(10, 10, 100, 100);
offscreenCanvasCtx.fill();
this.textValue = offscreenCanvasCtx.isPointInPath(30, 70);
var bitmap = offscreen.transferToImageBitmap();
canvas.transferFromImageBitmap(bitmap);
}
}
```
![](figures/en-us_image_0000001224354967.png)
### isPointInStroke<a name="section18889155054014"></a>
isPointInStroke\(path?: Path2D, x: number, y: number\): boolean
Checks whether a specified point is on the edge line of a path. Checks whether a specified point is on the edge line of a path.
- Parameters **Parameters**
| Name | Type | Mandatory | Description |
<a name="table101720539407"></a> | ---- | ------ | ---- | ----------------------------- |
<table><thead align="left"><tr id="row1317185315401"><th class="cellrowborder" valign="top" width="21.04%" id="mcps1.1.5.1.1"><p id="p71725384017"><a name="p71725384017"></a><a name="p71725384017"></a>Name</p> | path | Path2D | No | Path used for checking. If this parameter is not set, the current path is used.|
</th> | x | number | Yes | X-coordinate of the point used for checking. |
<th class="cellrowborder" valign="top" width="15.260000000000002%" id="mcps1.1.5.1.2"><p id="p171715334016"><a name="p171715334016"></a><a name="p171715334016"></a>Type</p> | y | number | Yes | Y-coordinate of the point used for checking. |
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="p1182841194515"><a name="p1182841194515"></a><a name="p1182841194515"></a>Mandatory</p> **Return value**
</th> | Type | Description |
<th class="cellrowborder" valign="top" width="56.18%" id="mcps1.1.5.1.4"><p id="p171718539408"><a name="p171718539408"></a><a name="p171718539408"></a>Description</p> | ------- | ------------- |
</th> | boolean | Whether a specified point is in the path area.|
</tr>
</thead> **Example**
<tbody><tr id="row121716534405"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p1717953184014"><a name="p1717953184014"></a><a name="p1717953184014"></a>path</p> ```html
</td> <!-- xxx.hml -->
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p171817535409"><a name="p171817535409"></a><a name="p171817535409"></a>Path2D</p> <div style="width: 180px; height: 60px;">
</td> <text>In path:{{textValue}}</text>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p8822419452"><a name="p8822419452"></a><a name="p8822419452"></a>No</p> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</td> </div>
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p91855319403"><a name="p91855319403"></a><a name="p91855319403"></a>Path used for checking. If this parameter is not set, the current path is used.</p> ```
</td>
</tr> ```js
<tr id="row1181653114010"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p518253104016"><a name="p518253104016"></a><a name="p518253104016"></a>x</p> // xxx.js
</td> export default {
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p17181653194010"><a name="p17181653194010"></a><a name="p17181653194010"></a>number</p> data: {
</td> textValue: 0
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p48214116452"><a name="p48214116452"></a><a name="p48214116452"></a>Yes</p> },
</td> onShow(){
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p518185344013"><a name="p518185344013"></a><a name="p518185344013"></a>X-coordinate of the point used for checking.</p> var canvas = this.$refs.canvas.getContext('2d');
</td> var offscreen = new OffscreenCanvas(500,500);
</tr> var offscreenCanvasCtx = offscreen.getContext("2d");
<tr id="row118185354016"><td class="cellrowborder" valign="top" width="21.04%" headers="mcps1.1.5.1.1 "><p id="p91895354013"><a name="p91895354013"></a><a name="p91895354013"></a>y</p>
</td> offscreenCanvasCtx.rect(10, 10, 100, 100);
<td class="cellrowborder" valign="top" width="15.260000000000002%" headers="mcps1.1.5.1.2 "><p id="p1318953104011"><a name="p1318953104011"></a><a name="p1318953104011"></a>number</p> offscreenCanvasCtx.stroke();
</td> this.textValue = offscreenCanvasCtx.isPointInStroke(50, 10);
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="p782114119457"><a name="p782114119457"></a><a name="p782114119457"></a>Yes</p>
</td> var bitmap = offscreen.transferToImageBitmap();
<td class="cellrowborder" valign="top" width="56.18%" headers="mcps1.1.5.1.4 "><p id="p2018195312409"><a name="p2018195312409"></a><a name="p2018195312409"></a>Y-coordinate of the point used for checking.</p> canvas.transferFromImageBitmap(bitmap);
</td> }
</tr> }
</tbody> ```
</table>
![en-us_image_0000001178875308](figures/en-us_image_0000001178875308.png)
- Return values
### resetTransform
<a name="table3572363195"></a>
<table><thead align="left"><tr id="row1572669197"><th class="cellrowborder" valign="top" width="19.77%" id="mcps1.1.3.1.1"><p id="p1857211681912"><a name="p1857211681912"></a><a name="p1857211681912"></a>Type</p> resetTransform(): void
</th>
<th class="cellrowborder" valign="top" width="80.23%" id="mcps1.1.3.1.2"><p id="p1257216171910"><a name="p1257216171910"></a><a name="p1257216171910"></a>Description</p> **Example**
</th> ```html
</tr> <!-- xxx.hml -->
</thead> <div style="width: 180px; height: 60px;">
<tbody><tr id="row195722063190"><td class="cellrowborder" valign="top" width="19.77%" headers="mcps1.1.3.1.1 "><p id="p8572369196"><a name="p8572369196"></a><a name="p8572369196"></a>boolean</p> <text>In path:{{textValue}}</text>
</td> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
<td class="cellrowborder" valign="top" width="80.23%" headers="mcps1.1.3.1.2 "><p id="p12572186101919"><a name="p12572186101919"></a><a name="p12572186101919"></a>Whether a specified point is in the path area.</p> </div>
</td> ```
</tr>
</tbody> ```js
</table> // xxx.js
export default {
- Example data:{
textValue:0
``` },
<!-- xxx.hml --> onShow(){
<div style="width: 180px; height: 60px;"> var canvas = this.$refs.canvas.getContext('2d');
<text>In path:{{textValue}}</text> var offscreen = new OffscreenCanvas(500,500);
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas> var offscreenCanvasCtx = offscreen.getContext("2d");
</div>
``` offscreenCanvasCtx.transform(1, 0, 1.7, 1, 0, 0);
offscreenCanvasCtx.fillStyle = 'gray';
``` offscreenCanvasCtx.fillRect(40, 40, 50, 20);
// xxx.js offscreenCanvasCtx.fillRect(40, 90, 50, 20);
export default {
data: { // Non-skewed rectangles
textValue: 0 offscreenCanvasCtx.resetTransform();
}, offscreenCanvasCtx.fillStyle = 'red';
onShow(){ offscreenCanvasCtx.fillRect(40, 40, 50, 20);
var canvas = this.$refs.canvas.getContext('2d'); offscreenCanvasCtx.fillRect(40, 90, 50, 20);
var offscreen = new OffscreenCanvas(500,500);
var offscreenCanvasCtx = offscreen.getContext("2d"); var bitmap = offscreen.transferToImageBitmap();
canvas.transferFromImageBitmap(bitmap);
offscreenCanvasCtx.rect(10, 10, 100, 100); }
offscreenCanvasCtx.stroke(); }
this.textValue = offscreenCanvasCtx.isPointInStroke(50, 10); ```
var bitmap = offscreen.transferToImageBitmap(); ![en-us_image_0000001179035242](figures/en-us_image_0000001179035242.png)
canvas.transferFromImageBitmap(bitmap);
}
}
```
![](figures/en-us_image_0000001178875308.png)
### resetTransform<a name="section1098812560426"></a>
resetTransform\(\): void
- Example
```
<!-- xxx.hml -->
<div style="width: 180px; height: 60px;">
<text>In path:{{textValue}}</text>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div>
```
```
//xxx.js
export default {
data:{
textValue:0
},
onShow(){
var canvas = this.$refs.canvas.getContext('2d');
var offscreen = new OffscreenCanvas(500,500);
var offscreenCanvasCtx = offscreen.getContext("2d");
offscreenCanvasCtx.transform(1, 0, 1.7, 1, 0, 0);
offscreenCanvasCtx.fillStyle = 'gray';
offscreenCanvasCtx.fillRect(40, 40, 50, 20);
offscreenCanvasCtx.fillRect(40, 90, 50, 20);
// Non-skewed rectangles
offscreenCanvasCtx.resetTransform();
offscreenCanvasCtx.fillStyle = 'red';
offscreenCanvasCtx.fillRect(40, 40, 50, 20);
offscreenCanvasCtx.fillRect(40, 90, 50, 20);
var bitmap = offscreen.transferToImageBitmap();
canvas.transferFromImageBitmap(bitmap);
}
}
```
![](figures/en-us_image_0000001179035242.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册