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

# row-gap (grid-row-gap)

APISummary
## Introduction

The `row-gap`/`grid-row-gap` CSS property sets the size of the gap (gutter) between an element's rows in [flexible box layout](/next/guide/ui/layout/flexible-box-layout.md) and grid layout.

For compatibility, `row-gap` or `grid-row-gap` can be used both.

## Examples

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

**Entry:** `src/row-gap`
**Bundle:** `dist/row-gap.lynx.bundle`

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

const RowGap = () => {
  const flexContainerStyle = {
    display: "flex" as const,
    flexWrap: "wrap" as const,
    rowGap: "15px",
    margin: "10px",
    border: "1px solid #000",
    borderRadius: "4px",
    marginBottom: "100rpx" as const,
  };

  const gridContainerStyle = {
    display: "grid" as const,
    rowGap: "10px",
    gridTemplateColumns: "1fr 1fr 1fr",
    margin: "10px",
    padding: "5px",
    border: "1px solid #000",
    borderRadius: "4px",
  };

  const titleStyle = {
    fontSize: "50rpx" as const,
    alignSelf: "center" as const,
    fontWeight: "900" as const,
    color: "linear-gradient(to right, rgb(255,53,26), rgb(0,235,235))" as const,
  };

  return (
    <>
      <text style={titleStyle}>using row-gap in flex layout</text>
      <view style={flexContainerStyle}>
        <text className="item">ONE</text>
        <text className="item">TWO</text>
        <text className="item">THREE</text>
        <text className="item">FOUR</text>
        <text className="item">FIVE</text>
        <text className="item">SIX</text>
        <text className="item">SEVEN</text>
        <text className="item">EIGHT</text>
        <text className="item">NINE</text>
        <text className="item">TEN</text>
      </view>

      <text style={titleStyle}>using row-gap in grid layout</text>
      <view style={gridContainerStyle}>
        <text className="item2">ONE</text>
        <text className="item2">TWO</text>
        <text className="item2">THREE</text>
        <text className="item2">FOUR</text>
        <text className="item2">FIVE</text>
        <text className="item2">SIX</text>
        <text className="item2">SEVEN</text>
        <text className="item2">EIGHT</text>
        <text className="item2">NINE</text>
        <text className="item2">TEN</text>
      </view>
    </>
  );
};

root.render(<RowGap />);

```

v0.11.0



## Values

### `<length>`

[`<length>`](/next/api/css/data-type/length.md) is the width of the gutter separating the rows.

### `<percentage>`

[`<percentage>`](/next/api/css/data-type/percentage.md) values are relative to the dimension of the element.

## Formal syntax

```
row-gap = <length-percentage [0,∞]>

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

## Syntax

```css
/* <length> values */
row-gap: 20px;
row-gap: 1em;

/* <percentage> value */
row-gap: 10%;

/* calc() values */
row-gap: calc(10% + 20px);
```

## Formal definition

| Initial value | `0` |
| Applies to | flex containers, grid containers |
| Inherited | no |
| Animatable |  |
| Percentages | refer to vertical dimension of its own content area |


## Differences from the Web

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

1. `normal` is not supported.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.row-gap`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| row-gap | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| grid-row-gap | Yes (2.1) | Unknown | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;flex&#95;layout | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| supported&#95;in&#95;flex&#95;layout.nested&#95;value&#95;1 | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| supported&#95;in&#95;grid&#95;layout | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.grid-row-gap | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.row-gap | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |

**`row-gap`**

<code>row-gap</code>

**Specifications:**

**`grid-row-gap`**

<code>grid-row-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

**`supported_in_flex_layout`**

Supported in Flexible Box Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

**`supported_in_flex_layout.nested_value_1`**

<code>row-gap</code> and <code>grid-row-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

**`supported_in_grid_layout`**

Supported in Grid Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

**`supported_in_grid_layout.grid-row-gap`**

<code>grid-row-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

**`supported_in_grid_layout.row-gap`**

<code>row-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/207-row-gap.json)

