1# Blank
2
3The **Blank** component is a spacer in the layout, automatically filling the remaining space along the main axis of its parent container. It works only when the parent component is [Row](ts-container-row.md), [Column](ts-container-column.md), or [Flex](ts-container-flex.md).
4
5>  **NOTE**
6>
7>  This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
8
9
10## Child Components
11
12Not supported
13
14
15## APIs
16
17Blank(min?: number | string)
18
19Since API version 10:
20 - When the **Blank** component is used within a [Row](ts-container-row.md), [Column](ts-container-column.md), or [Flex](ts-container-flex.md) container, it will automatically stretch or shrink along the main axis if it does not have a main axis size specified. If the **Blank** component has a main axis size specified or if the container is set to adapt to the size of its child nodes, the component will not automatically stretch or shrink.
21 - Relationship between **size** and **min** of the **Blank** component on the main axis: max(min, size).
22 - If the **Blank** component has a cross axis size specified, it will not fill up the parent container on the cross axis. If it does not have a cross axis size specified, it will fill up the parent container on the cross axis, following the **ItemAlign.Stretch** mode, the default setting of **alignSelf**.
23
24**Widget capability**: This API can be used in ArkTS widgets since API version 9.
25
26**Atomic service API**: This API can be used in atomic services since API version 11.
27
28**System capability**: SystemCapability.ArkUI.ArkUI.Full
29
30**Parameters**
31
32| Name| Type| Mandatory| Description|
33| -------- | -------- | -------- | -------- |
34| min | number \| string | No| Minimum size of the **Blank** component in the container along the main axis.<br>Default value: **0**<br>**NOTE**<br>This parameter cannot be set in percentage. If the value is negative, the default value is used. If the minimum size is larger than the available space of the container, it is used as the component size, and the component extends beyond the container.|
35
36## Attributes
37
38In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported.
39
40### color
41
42color(value: ResourceColor)
43
44Sets the color to fill the blank.
45
46**Widget capability**: This API can be used in ArkTS widgets since API version 9.
47
48**Atomic service API**: This API can be used in atomic services since API version 11.
49
50**System capability**: SystemCapability.ArkUI.ArkUI.Full
51
52**Parameters**
53
54| Name| Type| Mandatory| Description|
55| -------- | -------- | -------- | -------- |
56| value | [ResourceColor](ts-types.md#resourcecolor) | Yes| Color to fill the blank.<br><br>Default value: **Color.Transparent**|
57
58## Events
59
60The [universal events](ts-universal-events-click.md) are supported.
61
62## Example
63
64### Example 1
65The sample below shows how the **Blank** component fills the empty spaces in the container in landscape and portrait modes.
66```ts
67// xxx.ets
68@Entry
69@Component
70struct BlankExample {
71  build() {
72    Column() {
73      Row() {
74        Text('Bluetooth').fontSize(18)
75        Blank()
76        Toggle({ type: ToggleType.Switch }).margin({ top: 14, bottom: 14, left: 6, right: 6 })
77      }.width('100%').backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })
78    }.backgroundColor(0xEFEFEF).padding(20)
79  }
80}
81```
82
83Portrait mode
84
85![en-us_image_0000001256858407](figures/en-us_image_0000001256858407.gif)
86
87Landscape mode
88
89![en-us_image_0000001212378418](figures/en-us_image_0000001212378418.gif)
90
91
92### Example 2
93Set the **min** parameter when the width of the parent container of the **Blank** component is not set.
94
95```ts
96// xxx.ets
97@Entry
98@Component
99struct BlankExample {
100  build() {
101    Column({ space: 20 }) {
102      // If the width of the parent container is not set, the Blank component becomes invalid. In this case, you can set min to specify the minimum width of the Blank component.
103      Row() {
104        Text('Bluetooth').fontSize(18)
105        Blank().color(Color.Yellow)
106        Toggle({ type: ToggleType.Switch }).margin({ top: 14, bottom: 14, left: 6, right: 6 })
107      }.backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })
108
109      Row() {
110        Text('Bluetooth').fontSize(18)
111        // Set the minimum width to 160.
112        Blank('160').color(Color.Yellow)
113        Toggle({ type: ToggleType.Switch }).margin({ top: 14, bottom: 14, left: 6, right: 6 })
114      }.backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })
115
116    }.backgroundColor(0xEFEFEF).padding(20).width('100%')
117  }
118}
119```
120If the width of the parent container is not set, set **min** to specify the minimum width of the **Blank** component.
121
122![blankmin](figures/blankmin.png)
123