The size attribute is used to set the width, height, padding, and margin of a component.
The size attributes are used to set the width, height, padding, and margin of a component.
> **NOTE**
>
> This event 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.
## Required Permissions
...
...
@@ -22,7 +22,7 @@ None
| size | {<br>width?: Length,<br>height?: Length<br>} | - | Size of the component.|
| padding | {<br>top?: Length,<br>right?: Length,<br>bottom?: Length,<br>left?: Length<br>} \| Length | 0 | Padding of the component.<br>When the parameter is of the **Length** type, the four paddings take effect.|
| margin | {<br>top?: Length,<br>right?: Length,<br>bottom?: Length,<br>left?: Length<br>}<br>\| Length | 0 | Margin of the component.<br>When the parameter is of the **Length** type, the four margins take effect.|
| constraintSize | {<br>minWidth?: Length,<br>maxWidth?: Length,<br>minHeight?: Length,<br>maxHeight?: Length<br>} | {<br>minWidth: 0,<br>maxWidth: Infinity,<br>minHeight: 0,<br>maxHeight: Infinity<br>} | Constraint size of the component, which is used to limit the size range during component layout.|
| constraintSize | {<br>minWidth?: Length,<br>maxWidth?: Length,<br>minHeight?: Length,<br>maxHeight?: Length<br>} | {<br>minWidth: 0,<br>maxWidth: Infinity,<br>minHeight: 0,<br>maxHeight: Infinity<br>} | Constraint size of the component, which is used to limit the size range during component layout.**constraintSize** takes precedence over **width** and **height**.|
| layoutWeight | number \| string | 0 | Weight of the component during layout. When the container size is determined, the layout of the component and sibling components is allocated based on the weight along the main axis. The component size setting is ignored.<br>> **NOTE**<br>> This attribute is valid only for the **Row**, **Column**, and **Flex** layouts.|