ant-design/components/flex/index.en-US.md
lijianan 1e0c3b8c58
🔥feat: new component Flex (#44362)
* feat: new component Flex

* feat: new component Flex

* fix: fix

* test: add test case

* fix: fix

* update size-limit

* test: update snap

* fix: fix

* test: update snap

* chore: add use client

* fix: lint

* test: update snap

* fix

* docs: add docs

* fix: fix demo

* clear

* demo: update demo

* update demos

* fix: fix

* fix: fix

* fix: fix

* fix: fix

* test: update snap

* fix: fix

* fix: fix

* demo: update demo

* feat: CP

* fix: use token

* fix: fix

* fix: fix test case

* test: update snap

* Update components/flex/style/index.ts

Co-authored-by: MadCcc <1075746765@qq.com>
Signed-off-by: lijianan <574980606@qq.com>

* Update components/flex/demo/align.tsx

Co-authored-by: MadCcc <1075746765@qq.com>
Signed-off-by: lijianan <574980606@qq.com>

* demo: update demo

* fix: fix

* docs

* update cover

* fix: fix

* test: update case

* fix: rerun CI

* fix: fix

* fix: fix

* fix: fix

* fix: fix

* demo: update demo

* fix: fix lint

* fix: fix

* fix: fix

* fix: fix

* fix:  fix

* fix: fix test case

* fix: fix

* docs: update docs

* fix: fix

* chore: fix

* chore: fix

* docs: update docs

* docs: update

* fix: fix demo

* type: update type

* add debug demo

---------

Signed-off-by: lijianan <574980606@qq.com>
Co-authored-by: 栗嘉男 <mac@macdeMacBook-Pro.local>
Co-authored-by: MadCcc <1075746765@qq.com>
2023-09-14 17:04:05 +08:00

2.1 KiB
Raw Blame History

category group title cover coverDark tag
Components Layout Flex https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*SMzgSJZE_AwAAAAAAAAAAAAADrJ8AQ/original https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*8yArQ43EGccAAAAAAAAAAAAADrJ8AQ/original New

Flex. Available since 5.10.0.

When To Use

  • Good for setting spacing between elements.
  • Suitable for setting various horizontal and vertical alignments.

Examples

Basic align gap Wrap combination debug

API

This component is available since antd@5.10.0. The default behavior of Flex in horizontal mode is to align upward, In vertical mode, aligns the stretch, You can adjust this via properties.

Common props refCommon props

Property Description type Default Version
vertical Is direction of the flex vertical, use flex-direction: column boolean false
wrap Set whether the element is displayed in a single line or in multiple lines reference flex-wrap nowrap
justify Sets the alignment of elements in the direction of the main axis reference justify-content normal
align Sets the alignment of elements in the direction of the cross axis reference align-items normal
flex flex CSS shorthand properties reference flex normal
gap Sets the gap between grids small | middle | large | string | number -
component custom element type React.ComponentType div

Design Token