1e41f4b71Sopenharmony_ci# Row 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **Row** component lays out child components horizontally. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## Child Components 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ciSupported 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## APIs 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciRow(value?:{space?: number | string }) 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**Parameters** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 26e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 27e41f4b71Sopenharmony_ci| space | number \| string | No| Horizontal spacing between two adjacent child components.<br>Since API version 9, this parameter does not take effect when it is set to a negative number or when **justifyContent** is set to **FlexAlign.SpaceBetween**, **FlexAlign.SpaceAround** or **FlexAlign.SpaceEvenly**.<br>Default value: **0**, in vp<br>**NOTE**<br>The value can be a number greater than or equal to 0 or a string that can be converted to a number.| 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci## Attributes 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ciIn addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported. 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci### alignItems 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_cialignItems(value: VerticalAlign) 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ciSets the alignment mode of child components in the vertical direction. 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci**Parameters** 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 49e41f4b71Sopenharmony_ci| ------ | --------------------------------------------------- | ---- | ------------------------------------------------------------ | 50e41f4b71Sopenharmony_ci| value | [VerticalAlign](ts-appendix-enums.md#verticalalign) | Yes | Alignment mode of child components in the vertical direction.<br>Default value: **VerticalAlign.Center**| 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci### justifyContent<sup>8+</sup> 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_cijustifyContent(value: FlexAlign) 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ciSets the alignment mode of the child components in the horizontal direction. 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci**Parameters** 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 67e41f4b71Sopenharmony_ci| ------ | ------------------------------------------- | ---- | ---------------------------------------------------------- | 68e41f4b71Sopenharmony_ci| value | [FlexAlign](ts-appendix-enums.md#flexalign) | Yes | Alignment mode of child components in the horizontal direction.<br>Default value: **FlexAlign.Start**| 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci> **NOTE** 71e41f4b71Sopenharmony_ci> 72e41f4b71Sopenharmony_ci> During row layout, child components do not shrink if [flexShrink](ts-universal-attributes-flex-layout.md#flexshrink) is not set for them. In this case, the total size of the child components on the main axis can exceed the size of the container on the main axis. 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci## Events 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ciThe [universal events](ts-universal-events-click.md) are supported. 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci## Example 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci```ts 81e41f4b71Sopenharmony_ci// xxx.ets 82e41f4b71Sopenharmony_ci@Entry 83e41f4b71Sopenharmony_ci@Component 84e41f4b71Sopenharmony_cistruct RowExample { 85e41f4b71Sopenharmony_ci build() { 86e41f4b71Sopenharmony_ci Column({ space: 5 }) { 87e41f4b71Sopenharmony_ci // Set the horizontal spacing between two adjacent child components to 5. 88e41f4b71Sopenharmony_ci Text('space').width('90%') 89e41f4b71Sopenharmony_ci Row({ space: 5 }) { 90e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0xAFEEEE) 91e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0x00FFFF) 92e41f4b71Sopenharmony_ci }.width('90%').height(107).border({ width: 1 }) 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ci // Set the alignment mode of the child components in the vertical direction. 95e41f4b71Sopenharmony_ci Text('alignItems(Bottom)').width('90%') 96e41f4b71Sopenharmony_ci Row() { 97e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0xAFEEEE) 98e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0x00FFFF) 99e41f4b71Sopenharmony_ci }.width('90%').alignItems(VerticalAlign.Bottom).height('15%').border({ width: 1 }) 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ci Text('alignItems(Center)').width('90%') 102e41f4b71Sopenharmony_ci Row() { 103e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0xAFEEEE) 104e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0x00FFFF) 105e41f4b71Sopenharmony_ci }.width('90%').alignItems(VerticalAlign.Center).height('15%').border({ width: 1 }) 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ci // Set the alignment mode of the child components in the horizontal direction. 108e41f4b71Sopenharmony_ci Text('justifyContent(End)').width('90%') 109e41f4b71Sopenharmony_ci Row() { 110e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0xAFEEEE) 111e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0x00FFFF) 112e41f4b71Sopenharmony_ci }.width('90%').border({ width: 1 }).justifyContent(FlexAlign.End) 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci Text('justifyContent(Center)').width('90%') 115e41f4b71Sopenharmony_ci Row() { 116e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0xAFEEEE) 117e41f4b71Sopenharmony_ci Row().width('30%').height(50).backgroundColor(0x00FFFF) 118e41f4b71Sopenharmony_ci }.width('90%').border({ width: 1 }).justifyContent(FlexAlign.Center) 119e41f4b71Sopenharmony_ci }.width('100%') 120e41f4b71Sopenharmony_ci } 121e41f4b71Sopenharmony_ci} 122e41f4b71Sopenharmony_ci``` 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci 125