2020-03-22 11:38:02 +08:00
|
|
|
|
---
|
|
|
|
|
category: Components
|
|
|
|
|
type: Layout
|
|
|
|
|
title: Space
|
|
|
|
|
cols: 1
|
2020-05-31 11:48:34 +08:00
|
|
|
|
cover: https://gw.alipayobjects.com/zos/antfincdn/wc6%263gJ0Y8/Space.svg
|
2020-03-22 11:38:02 +08:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Set components spacing.
|
|
|
|
|
|
|
|
|
|
## When To Use
|
|
|
|
|
|
2022-10-18 16:23:10 +08:00
|
|
|
|
- Avoid components clinging together and set a unified space.
|
|
|
|
|
- Use Space.Compact when child form components are compactly connected and the border is collapsed.
|
2020-03-22 11:38:02 +08:00
|
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
|
|
| Property | Description | Type | Default | Version |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
2022-07-22 14:14:01 +08:00
|
|
|
|
| align | Align items | `start` \| `end` \|`center` \|`baseline` | - | 4.2.0 |
|
2020-06-30 11:25:55 +08:00
|
|
|
|
| direction | The space direction | `vertical` \| `horizontal` | `horizontal` | 4.1.0 |
|
2020-11-27 13:40:40 +08:00
|
|
|
|
| size | The space size | [Size](#Size) \| [Size\[\]](#Size) | `small` | 4.1.0 \| Array: 4.9.0 |
|
2020-10-08 18:41:40 +08:00
|
|
|
|
| split | Set split | ReactNode | - | 4.7.0 |
|
2020-11-27 13:40:40 +08:00
|
|
|
|
| wrap | Auto wrap line, when `horizontal` effective | boolean | false | 4.9.0 |
|
|
|
|
|
|
|
|
|
|
### Size
|
|
|
|
|
|
|
|
|
|
`'small' | 'middle' | 'large' | number`
|
2022-10-18 16:23:10 +08:00
|
|
|
|
|
|
|
|
|
### Space.Compact
|
|
|
|
|
|
|
|
|
|
Use Space.Compact when child form components are compactly connected and the border is collapsed. The supported components are:
|
|
|
|
|
|
|
|
|
|
- Button
|
|
|
|
|
- AutoComplete
|
|
|
|
|
- Cascader
|
|
|
|
|
- DatePicker
|
|
|
|
|
- Input/Input.Search
|
|
|
|
|
- Select
|
|
|
|
|
- TimePicker
|
|
|
|
|
- TreeSelect
|
|
|
|
|
|
|
|
|
|
| Property | Description | Type | Default | Version |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| block | Option to fit width to its parent\'s width | boolean | false | 4.24.0 |
|
|
|
|
|
| direction | Set direction of layout | `vertical` \| `horizontal` | `horizontal` | 4.24.0 |
|
|
|
|
|
| size | Set child component size | `large` \| `middle` \| `small` | `middle` | 4.24.0 |
|