> 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-grow

APISummary
## Introduction

The `flex-grow` CSS property sets the flex grow factor, which specifies how much of the flex container's remaining space should be assigned to the flex item's main size.

When the flex-container's main size is larger than the combined main sizes of the flex items, the extra space is distributed among the flex items, with each item growth being their growth factor value as a proportion of the sum total of all the container's items' flex grow factors.

The main size is either width or height of the item which is dependent on the [`flex-direction`](/next/api/css/properties/flex-direction.md) value.

`flex-grow` is used alongside the other flex properties [`flex-shrink`](/next/api/css/properties/flex-shrink.md) and [`flex-basis`](/next/api/css/properties/flex-basis.md), and normally defined using the [flex](/next/api/css/properties/flex.md) shorthand to ensure all values are set.

## Examples

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

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

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

const FlexGrow = () => {
  const grow1Style = {
    backgroundColor: "rgba(0,255,0,0.2)" as const,
    flexGrow: 1,
  };

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

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

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <view className="container">
          <view className="height" style={grow1Style}>
            <text>flex-grow:1</text>
          </view>
          <view className="height" style={item2Style}>
            <text>Item Two</text>
          </view>
          <view className="height" style={item3Style}>
            <text>Item Three</text>
          </view>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<FlexGrow />);

```

v0.11.0



## Syntax

```css
/* <number> values */
flex-grow: 3;
flex-grow: 0.6;
```

### Values

- [`<number>`](/next/api/css/data-type/number.md)

  Negative values are invalid, **Defaults** to `0`。

## Formal definition

| Initial value | 0 |
| Applies to | flex items |
| Inherited | no |
| Animatable | yes |


## Formal syntax

```
flex-grow =
  <number [0,∞]>
```

## Compatibility

**Compatibility Table**

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

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

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

**`flex-grow`**

**Specifications:**

