ant-design/docs/spec/proximity.en-US.md

39 lines
2.0 KiB
Markdown
Raw Normal View History

2016-07-31 10:17:07 +08:00
---
2019-12-26 15:27:52 +08:00
category: Design Patterns
type: Principles
2016-07-31 10:17:07 +08:00
order: 1
title: Proximity
---
When several items are in close proximity to each other, they become one visual unit rather than several separate units. Otherwise, their distance should be larger and look more like several visual units. The basic purpose of proximity is to organize. To give an apparent view of the page structure and the hierarchy of information to users.
---
## The relation of vertical spacing
2018-01-05 12:40:54 +08:00
<img class="preview-img" align="right" alt="Example of the different vertical distance" description="In Ant Design, the three different formats are 8px (small spacing), 16px (middle spacing) and 24px (large spacing)." src="https://gw.alipayobjects.com/zos/rmsportal/goazWUHPXsGEDFIGsNlm.png">
2016-07-31 10:17:07 +08:00
Divide the hierarchy of information through three formats:「small spacing」, 「middle spacing」and「large spacing」
2016-07-31 10:17:07 +08:00
<br>
<img class="preview-img" align="right" alt="Example of added element" description="To make the hierarchy more apparent through adding 「guides」." src="https://gw.alipayobjects.com/zos/rmsportal/XNFCsupiYDBTJFQkmOmv.png">
2016-07-31 10:17:07 +08:00
In the case that the three formats are applicable, the hierarchy of information can be separated clearly through adding or cutting down the multiple of 「basic spacing」, or adding elements.
2016-07-31 10:17:07 +08:00
> Note: in Ant Design, y = 8 + 8 \* n, among which, n >= 0, y stands for the vertical spacing and 8 represents 「basic spacing」.
2016-07-31 10:17:07 +08:00
---
2018-01-05 12:40:54 +08:00
## Relationship of horizontal spacing
2016-07-31 10:17:07 +08:00
2018-01-05 12:40:54 +08:00
<img class="preview-img" align="right" alt="Example of combination and configuration" src="https://gw.alipayobjects.com/zos/rmsportal/uYvsqAUXNaqURGIhZhxz.png">
2016-07-31 10:17:07 +08:00
2018-01-05 12:40:54 +08:00
To adapt to screens of different sizes, in the horizontal direction, use grid layout to arrange the components to ensure the flexibility of the layout.
2016-07-31 10:17:07 +08:00
<br>
2018-01-05 12:40:54 +08:00
<img class="preview-img" align="right" alt="Example of checkbox" src="https://gw.alipayobjects.com/zos/rmsportal/ysXfdKqmdDRAimBiKVGS.png">
2016-07-31 10:17:07 +08:00
In the inner of a component, the horizontal spacing of elements should differ too.