> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# flex-flow

APISummary
## 介绍

定义弹性容器中的元件排列方向及单或多行（列）堆叠方向，是 [`flex-direction`](/next/zh/api/css/properties/flex-direction.md) 和 [`flex-wrap`](/next/zh/api/css/properties/flex-wrap.md) 的简写属性。

## 使用示例

**下面是一个示例: css-api**

**Entry:** `src/flex-flow`
**Bundle:** `dist/flex-flow.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const FlexFlow = () => {
  const flowStyle = {
    flexFlow: "row wrap" as const,
  };

  const flow2Style = {
    flexDirection: "row" as const,
    flexWrap: "wrap" as const,
  };

  const item1Style = {
    backgroundColor: "rgba(0,255,0,0.2)" as const,
    flexShrink: 0,
    width: "50%",
  };

  const item2Style = {
    backgroundColor: "rgba(0,0,255,0.2)" as const,
    flexShrink: 0,
    marginLeft: "10px",
  };

  const item3Style = {
    backgroundColor: "rgba(255,0,0,0.2)" as const,
    flexShrink: 0,
    marginLeft: "10px",
  };

  const item4Style = {
    backgroundColor: "rgba(255,0,0,0.2)" as const,
    flexShrink: 0,
    marginLeft: "10px",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <text>flex-flow: row wrap</text>
      <view className="container" style={flowStyle}>
        <view className="height" style={item1Style}>
          <text>Item One</text>
        </view>
        <view className="height" style={item2Style}>
          <text>Item Two</text>
        </view>
        <view className="height" style={item3Style}>
          <text>Item Three</text>
        </view>
        <view className="height" style={item4Style}>
          <text>Item Four</text>
        </view>
      </view>
      <text>flex-direction: row; flex-wrap: wrap</text>
      <view className="container" style={flow2Style}>
        <view className="height" style={item1Style}>
          <text>Item One</text>
        </view>
        <view className="height" style={item2Style}>
          <text>Item Two</text>
        </view>
        <view className="height" style={item3Style}>
          <text>Item Three</text>
        </view>
        <view className="height" style={item4Style}>
          <text>Item Four</text>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<FlexFlow />);

```

v0.11.0



## 语法

```css
/* flex-flow: <'flex-direction'> */
flex-flow: row;
flex-flow: row-reverse;
flex-flow: column;
flex-flow: column-reverse;

/* flex-flow: <'flex-wrap'> */
flex-flow: nowrap;
flex-flow: wrap;
flex-flow: wrap-reverse;

/* flex-flow: <'flex-direction'> and <'flex-wrap'> */
flex-flow: row nowrap;
flex-flow: column wrap;
flex-flow: column-reverse wrap-reverse;
```

### 取值

更多取值信息请查看 [`flex-direction`](/next/zh/api/css/properties/flex-direction.md) 和 [`flex-wrap`](/next/zh/api/css/properties/flex-wrap.md)。

## 形式定义

| 初始值 | as each of the properties of the shorthand: 
- flex-direction: row
- flex-wrap: nowrap |
| 适用元素 | 弹性容器 |
| 是否支持继承 | 否 |
| 是否支持动画 |  |


## 形式语法

```
flex-flow =
  <'flex-direction'>  ||
  <'flex-wrap'>

<flex-direction> =
  row             |
  row-reverse     |
  column          |
  column-reverse

<flex-wrap> =
  nowrap        |
  wrap          |
  wrap-reverse
```

## 兼容性

**Compatibility Table**

**Query:** `css.properties.flex-flow`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/146-flex-flow.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/flex-flow)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| flex-flow | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`flex-flow`**

**Specifications:**

