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

APISummary
## Introduction

Defines the shrink factor of the flex element on the main axis. After the flex container layout elements, if there is an element overflow, the corresponding element will be scaled according to the element's zoom factor ratio to ensure that the element will not overflow the container.

## Examples

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

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

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

const FlexShrink = () => {
  const shrink1Style = {
    backgroundColor: "rgba(0,255,0,0.2)" as const,
    flexShrink: 1,
  };

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

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

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

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <view className="container">
          <view className="height" style={shrink1Style}>
            <text>flex-shrink:1</text>
          </view>
          <view className="height" style={shrink2Style}>
            <text>flex-shrink:2</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(<FlexShrink />);

```

v0.11.0



## Syntax

```css
/* <number> values */
flex-shrink: 2;
flex-shrink: 0;
```

### Values

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

  Negative values are invalid. Defaults to `1`.

## Formal definition

| Initial value | 1 |
| Applies to | flex items |
| Inherited | no |
| Animatable |  |


## Formal syntax

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

## Compatibility

**Compatibility Table**

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

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

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

**`flex-shrink`**

**Specifications:**

