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

# min-width

APISummary
## Introduction

To specify min width of a view. It prevents the applied value of [`width`](/next/api/css/properties/width.md) becoming larger than the specified value of `min-width`.
The priority of `min-width` is higher than [`width`](/next/api/css/properties/width.md) but lower than [`max-width`](/next/api/css/properties/max-width.md).

## Examples

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

**Entry:** `src/min-width`
**Bundle:** `dist/min-width.lynx.bundle`

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

const MinWidth = () => {
  const containerStyle = {
    display: "linear" as const,
  };

  const firstBoxStyle = {
    width: "300px",
    backgroundColor: "green",
  };

  const secondBoxStyle = {
    width: "0px",
    backgroundColor: "yellow",
    minWidth: "300px",
  };

  const thirdBoxStyle = {
    width: "0px",
    backgroundColor: "blue",
    minWidth: "300px",
    maxWidth: "200px",
  };

  return (
    <view className="intro" style={containerStyle}>
      <view style={firstBoxStyle}>
        <text>width: 300px</text>
      </view>
      <view style={secondBoxStyle}>
        <text>width: 0px; min-width: 300px</text>
      </view>
      <view style={thirdBoxStyle}>
        <text>width: 0px; min-width: 300px; max-width: 200px</text>
      </view>
    </view>
  );
};

root.render(<MinWidth />);

```

v0.11.0



## Syntax

```css
/* <length> */
min-width: 120px;
min-width: 10em;

/* <percentage> */
min-width: 75%;
```

### Values

#### `<length>`

[`<length>`](/next/api/css/data-type/length.md) defines the min-width as an absolute value. Default to `0px`.

#### `<percentage>`

Defines the min-width as a percentage of the containing block's width.

## Formal definition

| Initial value | 0px |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |
| Percentages | refer to the width of the containing block |


## Formal syntax

```
min-width = <length-percentage [0,∞]>

<length-percentage> =
  <length>      |
  <percentage>
```

## Differences from the Web

[mdn:min-width](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width)

1. In Lynx, the priority of `max-width` is higher than `width` and `min-width`. While in Web, `max-width` overrides `width`, but `min-width` overrides `max-width`.
2. If `max-width` is specified smaller than `min-width`, `min-width` will be ignored.
3. `auto` is not supported, default value is `0px`.
4. `max-content`, `min-content`, `fit-content`, `min-content` are not supported.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.min-width`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| min-width | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`min-width`**

sets the minimum width of an element.

**Specifications:**

