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

# flex-wrap

APISummary
## Introduction

The `flex-wrap` CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked.

## Examples

**This is an example below: css-api**

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

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

const FlexWrap = () => {
  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">
      <view className="fixed_area">
        <text>flex-wrap:nowrap</text>
        <view className="container nowrap">
          <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-wrap:nowrap</text>
        <view className="container wrap">
          <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-wrap:wrap-reverse</text>
        <view className="container wrap-reverse">
          <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>
      </view>
    </scroll-view>
  );
};

root.render(<FlexWrap />);

```

v0.11.0



## Syntax

```css
flex-wrap: nowrap; /* Default value */
flex-wrap: wrap;
flex-wrap: wrap-reverse;
```

### Values

- `nowrap`

  **Default value**. The flex items are laid out in a single line which may cause the flex container to overflow. The cross-start is either equivalent to start or before depending on the [`flex-direction`](/next/api/css/properties/flex-direction.md) value.

- `wrap`

  The flex items break into multiple lines. The cross-start is either equivalent to start or before depending [`flex-direction`](/next/api/css/properties/flex-direction.md) value and the cross-end is the opposite of the specified cross-start.

- `wrap-reverse`

  Behaves the same as `wrap` but cross-start and cross-end are permuted.

## Formal definition

| Initial value | nowrap |
| Applies to | flex containers |
| Inherited | no |
| Animatable |  |


## Formal syntax

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

## Compatibility

**Compatibility Table**

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

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/54-flex-wrap.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| flex-wrap | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| nowrap | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| wrap | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| wrap-reverse | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`flex-wrap`**

**Specifications:**

**`nowrap`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/54-flex-wrap.json)

**`wrap`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/54-flex-wrap.json)

**`wrap-reverse`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/54-flex-wrap.json)

