1e41f4b71Sopenharmony_ci# Size
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe size attributes set the width, height, and margin of a component.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci>  **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci>  The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## width
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciwidth(value: Length)
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciSets the width of the component. By default, the width required to fully hold the component content is used. If the width of the component is greater than that of the parent container, the component will be drawn beyond the parent container scope.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci**Parameters**
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci| Name  | Type                          | Mandatory  | Description                 |
26e41f4b71Sopenharmony_ci| ----- | ---------------------------- | ---- | ------------------- |
27e41f4b71Sopenharmony_ci| value | [Length](ts-types.md#length) | Yes   | Width of the component to set.<br>Unit: vp|
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci>  **NOTE**
30e41f4b71Sopenharmony_ci>
31e41f4b71Sopenharmony_ci>  - For the **\<TextInput>** component, the **auto** option of **width** means to adapt to the text width.
32e41f4b71Sopenharmony_ci>  
33e41f4b71Sopenharmony_ci>  - For the **\<AlphabetIndexer>** component, the **auto** option of **width** means to adapt to the maximum width of index entries.
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci## height
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ciheight(value: Length)
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ciSets the height of the component. By default, the height required to fully hold the component content is used. If the height of the component is greater than that of the parent container, the component will be drawn beyond the parent container scope.
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci**Parameters**
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci| Name  | Type                          | Mandatory  | Description                 |
52e41f4b71Sopenharmony_ci| ----- | ---------------------------- | ---- | ------------------- |
53e41f4b71Sopenharmony_ci| value | [Length](ts-types.md#length) | Yes   | Height of the component to set.<br>Unit: vp|
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ci>  **NOTE**
56e41f4b71Sopenharmony_ci>
57e41f4b71Sopenharmony_ci>  For the **\<Row>**, **\<Column>**, and **\<RelativeContainer>** components, the **auto** option of **width** and **height** means to adapt to their child components.
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci## size
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_cisize(value: SizeOptions)
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_ciSets the size of the component.
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ci**Parameters**
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci| Name  | Type                             | Mandatory  | Description               |
76e41f4b71Sopenharmony_ci| ----- | ------------------------------- | ---- | ----------------- |
77e41f4b71Sopenharmony_ci| value | [SizeOptions](#sizeoptions) | Yes   | Size of the component to set.<br>Unit: vp|
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci## padding
80e41f4b71Sopenharmony_ci
81e41f4b71Sopenharmony_cipadding(value: Padding | Length | LocalizedPadding)
82e41f4b71Sopenharmony_ci
83e41f4b71Sopenharmony_ciSets the padding of the component.
84e41f4b71Sopenharmony_ci
85e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ci**Parameters**
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci| Name  | Type                                      | Mandatory  | Description                                      |
96e41f4b71Sopenharmony_ci| ----- | ---------------------------------------- | ---- | ---------------------------------------- |
97e41f4b71Sopenharmony_ci| value | [Padding](ts-types.md#padding) \|  [Length](ts-types.md#length) \|   [LocalizedPadding](ts-types.md#localizedpadding12)<sup>12+</sup>| Yes   | Padding of the component to set.<br>When the parameter is of the **Length** type, the four paddings take effect.<br>Default value: **0**<br>Unit: vp<br>When **padding** is set to a percentage, the width of the parent container is used as the basic value.|
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci## margin
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_cimargin(value: margin | Length | LocalizedMargin)
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ciSets the margin of the component.
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
106e41f4b71Sopenharmony_ci
107e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
108e41f4b71Sopenharmony_ci
109e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ci**Parameters**
114e41f4b71Sopenharmony_ci
115e41f4b71Sopenharmony_ci| Name| Type                                                        | Mandatory    | Description                                                        |
116e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
117e41f4b71Sopenharmony_ci| value  | [Margin](ts-types.md#margin) \| [Length](ts-types.md#length) \| [LocalizedMargin](ts-types.md#localizedmargin12)<sup>12+</sup> | Yes| Margin of the component to set.<br>When the parameter is of the **Length** type, the four margins take effect.<br>Default value: **0**<br>Unit: vp<br>When **margin** is set to a percentage, the width of the parent container is used as the basic value. When child components are laid out along the cross axis of the **\<Row>**, **\<Column>**, or **\<Flex>** container, the cross axis size of the child components and the margins add up to the total size of the container.<br>For example, if the width of the **\<Column>** container is 100, the width of the child component is 50, the left margin is 10, and the right margin is 20, then the actual horizontal offset of the child component is 10.|
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci## layoutWeight
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_cilayoutWeight(value: number | string)
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ciSets the weight of the component during layout.
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ci**Parameters**
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ci| Name  | Type                        | Mandatory     | Description                                      |
134e41f4b71Sopenharmony_ci| ----- | -------------------------- | ------- | ---------------------------------------- |
135e41f4b71Sopenharmony_ci| value | number \| string | Yes| Weight of the component during layout. When the container size is determined, the container space is allocated along the main axis among the component and sibling components based on the layout weight, and the component size setting is ignored.<br>Default value: **0**<br>**NOTE**<br>This attribute is valid only for the **\<Row>**, **\<Column>**, and **\<Flex>** layouts.<br>The value can be a number greater than or equal to 0 or a string that can be converted to a number.|
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci## constraintSize
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ciconstraintSize(value: ConstraintSizeOptions)
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ciSets the constraint size of the component, which is used to limit the size range during component layout.
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ciSince API version 10, this API supports the calc calculation feature.
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci**Parameters**
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ci| Name  | Type                                      | Mandatory  | Description                                      |
154e41f4b71Sopenharmony_ci| ----- | ---------------------------------------- | ---- | ---------------------------------------- |
155e41f4b71Sopenharmony_ci| value | [ConstraintSizeOptions](ts-types.md#constraintsizeoptions) | Yes   | Constraint size of the component to set. **constraintSize** takes precedence over **width** and **height**. See **Impact of constraintSize on width/height**.<br>Default value:<br>{<br>minWidth: 0,<br>maxWidth: Infinity,<br>minHeight: 0,<br>maxHeight: Infinity<br>}<br>Unit: vp<br>|
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci**Impact of constraintSize on width/height**
158e41f4b71Sopenharmony_ci
159e41f4b71Sopenharmony_ci| Default Value                                     | Result                                      |
160e41f4b71Sopenharmony_ci| ---------------------------------------- | ---------------------------------------- |
161e41f4b71Sopenharmony_ci| /                                        | max(minWidth/minHeight, min(maxWidth/maxHeight, width/height)) |
162e41f4b71Sopenharmony_ci| maxWidth/maxHeight                       | max(minWidth/minHeight, width/height)    |
163e41f4b71Sopenharmony_ci| minWidth/minHeight                       | min(maxWidth/maxHeight, width/height)    |
164e41f4b71Sopenharmony_ci| width/height                             | In the case of maxWidth/maxHeight > minWidth/minHeight, the layout logic of the component is used,<br>and the result is between maxWidth/maxHeight and minWidth/minHeight.<br> In other cases, the result is max(minWidth/minHeight, maxWidth/maxHeight).|
165e41f4b71Sopenharmony_ci| maxWidth/maxHeight && width/height       | minWidth/minHeight                       |
166e41f4b71Sopenharmony_ci| minWidth/minHeight && width/height       | The layout logic of the component is used. The final result does not exceed maxWidth/maxHeight.    |
167e41f4b71Sopenharmony_ci| maxWidth/maxHeight && minWidth/minHeight | Width/Height, which may be stretched or compressed based on other layout attributes.          |
168e41f4b71Sopenharmony_ci| maxWidth/maxHeight && minWidth/minHeight && width/height | The layout restrictions passed by the parent container are used for layout.                       |
169e41f4b71Sopenharmony_ci
170e41f4b71Sopenharmony_ci## SizeOptions
171e41f4b71Sopenharmony_ci
172e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
173e41f4b71Sopenharmony_ci
174e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
175e41f4b71Sopenharmony_ci
176e41f4b71Sopenharmony_ci| Name  | Type                                      | Mandatory  | Description                                      |
177e41f4b71Sopenharmony_ci| ----- | ---------------------------------------- | ---- | ---------------------------------------- |
178e41f4b71Sopenharmony_ci| width  | [Length](ts-types.md#length) | No| Component width.|
179e41f4b71Sopenharmony_ci| height | [Length](ts-types.md#length) | No| Component height.|
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci## ConstraintSizeOptions
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci| Name  | Type                                      | Mandatory  | Description                                      |
188e41f4b71Sopenharmony_ci| ----- | ---------------------------------------- | ---- | ---------------------------------------- |
189e41f4b71Sopenharmony_ci| minWidth  | [Length](ts-types.md#length) | No| Minimum width of the component.|
190e41f4b71Sopenharmony_ci| maxWidth  | [Length](ts-types.md#length) | No| Maximum width of the component.|
191e41f4b71Sopenharmony_ci| minHeight | [Length](ts-types.md#length) | No| Minimum height of the component.|
192e41f4b71Sopenharmony_ci| maxHeight | [Length](ts-types.md#length) | No| Maximum height of the component.|
193e41f4b71Sopenharmony_ci
194e41f4b71Sopenharmony_ci>  **NOTE**
195e41f4b71Sopenharmony_ci>
196e41f4b71Sopenharmony_ci>  For the **\<Row>**, **\<Column>**, and **\<RelativeContainer>** components, the **auto** option of **width** and **height** means to adapt to their child components. For the **\<TextInput>** component, the **auto** option of **width** means to adapt to the text width.
197e41f4b71Sopenharmony_ci
198e41f4b71Sopenharmony_ci## Example
199e41f4b71Sopenharmony_ci### Example 1
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci```ts
202e41f4b71Sopenharmony_ci// xxx.ets
203e41f4b71Sopenharmony_ci@Entry
204e41f4b71Sopenharmony_ci@Component
205e41f4b71Sopenharmony_cistruct SizeExample {
206e41f4b71Sopenharmony_ci  build() {
207e41f4b71Sopenharmony_ci    Column({ space: 10 }) {
208e41f4b71Sopenharmony_ci      Text('margin and padding:').fontSize(12).fontColor(0xCCCCCC).width('90%')
209e41f4b71Sopenharmony_ci      Row() {
210e41f4b71Sopenharmony_ci        // Width: 80; height: 80; margin: 20 (blue area); top, bottom, left, and right paddings: 5, 15, 10, and 20 (white area)
211e41f4b71Sopenharmony_ci        Row() {
212e41f4b71Sopenharmony_ci          Row().size({ width: '100%', height: '100%' }).backgroundColor(Color.Yellow)
213e41f4b71Sopenharmony_ci        }
214e41f4b71Sopenharmony_ci        .width(80)
215e41f4b71Sopenharmony_ci        .height(80)
216e41f4b71Sopenharmony_ci        .padding({ top: 5, left: 10, bottom: 15, right: 20 })
217e41f4b71Sopenharmony_ci        .margin(20)
218e41f4b71Sopenharmony_ci        .backgroundColor(Color.White)
219e41f4b71Sopenharmony_ci      }.backgroundColor(Color.Blue)
220e41f4b71Sopenharmony_ci
221e41f4b71Sopenharmony_ci      Text('constraintSize').fontSize(12).fontColor(0xCCCCCC).width('90%')
222e41f4b71Sopenharmony_ci      Text('this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text.this is a Text')
223e41f4b71Sopenharmony_ci        .width('90%')
224e41f4b71Sopenharmony_ci        .constraintSize({ maxWidth: 200 })
225e41f4b71Sopenharmony_ci
226e41f4b71Sopenharmony_ci      Text('layoutWeight').fontSize(12).fontColor(0xCCCCCC).width('90%')
227e41f4b71Sopenharmony_ci      // When the container size is determined, the component occupies the space along the main axis based on the layout weight, and the component size setting is ignored.
228e41f4b71Sopenharmony_ci      Row() {
229e41f4b71Sopenharmony_ci        // Weight 1: The component occupies 1/3 of the remaining space along the main axis.
230e41f4b71Sopenharmony_ci        Text('layoutWeight(1)')
231e41f4b71Sopenharmony_ci          .size({ width: '30%', height: 110 }).backgroundColor(0xFFEFD5).textAlign(TextAlign.Center)
232e41f4b71Sopenharmony_ci          .layoutWeight(1)
233e41f4b71Sopenharmony_ci        // Weight 2: The component occupies 2/3 of the remaining space along the main axis.
234e41f4b71Sopenharmony_ci        Text('layoutWeight(2)')
235e41f4b71Sopenharmony_ci          .size({ width: '30%', height: 110 }).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
236e41f4b71Sopenharmony_ci          .layoutWeight(2)
237e41f4b71Sopenharmony_ci        // If layoutWeight is not set, the component is rendered based on its own size setting.
238e41f4b71Sopenharmony_ci        Text('no layoutWeight')
239e41f4b71Sopenharmony_ci          .size({ width: '30%', height: 110 }).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
240e41f4b71Sopenharmony_ci      }.size({ width: '90%', height: 140 }).backgroundColor(0xAFEEEE)
241e41f4b71Sopenharmony_ci      // calc calculation feature
242e41f4b71Sopenharmony_ci      Text('calc:').fontSize(12).fontColor(0xCCCCCC).width('90%')
243e41f4b71Sopenharmony_ci      Text('calc test')
244e41f4b71Sopenharmony_ci        .fontSize(50)
245e41f4b71Sopenharmony_ci        .fontWeight(FontWeight.Bold)
246e41f4b71Sopenharmony_ci        .backgroundColor(0xFFFAF0)
247e41f4b71Sopenharmony_ci        .textAlign(TextAlign.Center)
248e41f4b71Sopenharmony_ci        .margin('calc(25vp*2)')
249e41f4b71Sopenharmony_ci        // If width or height is set to a percentage, the width or height of the parent container are used as the basic value.
250e41f4b71Sopenharmony_ci        .size({ width: 'calc(90%)', height: 'calc(50vp + 10%)' })
251e41f4b71Sopenharmony_ci    }.width('100%').margin({ top: 5 })
252e41f4b71Sopenharmony_ci  }
253e41f4b71Sopenharmony_ci}
254e41f4b71Sopenharmony_ci```
255e41f4b71Sopenharmony_ci
256e41f4b71Sopenharmony_ci![size](figures/size.png)
257e41f4b71Sopenharmony_ci
258e41f4b71Sopenharmony_ci### Example 2
259e41f4b71Sopenharmony_ci```ts
260e41f4b71Sopenharmony_ci// xxx.ets
261e41f4b71Sopenharmony_ci// In the following, the padding and margin attributes are of the LocalizedPadding and LocalizedMargin types, respectively.
262e41f4b71Sopenharmony_ci
263e41f4b71Sopenharmony_ciimport { LengthMetrics } from '@kit.ArkUI'
264e41f4b71Sopenharmony_ci
265e41f4b71Sopenharmony_ci@Entry
266e41f4b71Sopenharmony_ci@Component
267e41f4b71Sopenharmony_cistruct SizeExample {
268e41f4b71Sopenharmony_ci  build() {
269e41f4b71Sopenharmony_ci    Column({ space: 10 }) {
270e41f4b71Sopenharmony_ci      Text('margin and padding:').fontSize(12).fontColor(0xCCCCCC).width('90%')
271e41f4b71Sopenharmony_ci      Row() {
272e41f4b71Sopenharmony_ci        // Set the width to 80, height to 80, top, bottom, start, and end paddings to 40, 20, 30, and 10, respectively (blue area), and top, bottom, start, and end margins to 5, 15, 10, and 20, respectively (white area).
273e41f4b71Sopenharmony_ci        Row() {
274e41f4b71Sopenharmony_ci          Row().size({ width: '100%', height: '100%' }).backgroundColor(Color.Yellow)
275e41f4b71Sopenharmony_ci        }
276e41f4b71Sopenharmony_ci        .width(80)
277e41f4b71Sopenharmony_ci        .height(80)
278e41f4b71Sopenharmony_ci        .padding({
279e41f4b71Sopenharmony_ci          top: LengthMetrics.vp(5),
280e41f4b71Sopenharmony_ci          bottom: LengthMetrics.vp(15),
281e41f4b71Sopenharmony_ci          start: LengthMetrics.vp(10),
282e41f4b71Sopenharmony_ci          end: LengthMetrics.vp(20)
283e41f4b71Sopenharmony_ci        })
284e41f4b71Sopenharmony_ci        .margin({
285e41f4b71Sopenharmony_ci          top: LengthMetrics.vp(40),
286e41f4b71Sopenharmony_ci          bottom: LengthMetrics.vp(20),
287e41f4b71Sopenharmony_ci          start: LengthMetrics.vp(30),
288e41f4b71Sopenharmony_ci          end: LengthMetrics.vp(10)
289e41f4b71Sopenharmony_ci        })
290e41f4b71Sopenharmony_ci        .backgroundColor(Color.White)
291e41f4b71Sopenharmony_ci      }.backgroundColor(Color.Blue)
292e41f4b71Sopenharmony_ci    }.width('100%').margin({ top: 5 })
293e41f4b71Sopenharmony_ci  }
294e41f4b71Sopenharmony_ci}
295e41f4b71Sopenharmony_ci```
296e41f4b71Sopenharmony_ci
297e41f4b71Sopenharmony_ciThe following shows how the example is represented with left-to-right scripts.
298e41f4b71Sopenharmony_ci
299e41f4b71Sopenharmony_ci![size](figures/size-ltr.png)
300e41f4b71Sopenharmony_ci
301e41f4b71Sopenharmony_ciThe following shows how the example is represented with right-to-left scripts.
302e41f4b71Sopenharmony_ci
303e41f4b71Sopenharmony_ci![size](figures/size-rtl.png)
304