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

# linear-direction

APISummary
## Introduction

The `linear-direction` CSS property sets how linear items are placed in the linear container defining the main axis and the direction.

Note that the values `row`, `row-reverse` are affected by the directionality of the linear container. If its [`dir`](/next/api/css/properties/direction.md) attribute is `ltr`, `row` represents the horizontal axis oriented from the left to the right, and `row-reverse` from the right to the left; if the `dir` attribute is `rtl`, `row` represents the axis oriented from the right to the left, and `row-reverse` from the left to the right.

## Examples

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

**Entry:** `src/linear-direction`
**Bundle:** `dist/linear-direction.lynx.bundle`

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

const LinearDirection = () => {
  const verticalContainerStyle = {
    display: "linear" as const,
    alignSelf: "center" as const,
    justifyContent: "center" as const,
    linearDirection: "column" as const,
  };

  const horizontalContainerStyle = {
    display: "linear" as const,
    alignSelf: "center" as const,
    justifyContent: "center" as const,
    linearDirection: "row" as const,
  };

  const redBoxStyle = {
    width: "70px",
    height: "70px",
    backgroundColor: "red",
  };

  const yellowBoxStyle = {
    width: "70px",
    height: "70px",
    backgroundColor: "yellow",
  };

  const greenBoxStyle = {
    width: "70px",
    height: "70px",
    backgroundColor: "green",
  };

  const textStyle = {
    fontSize: "50rpx" as const,
    alignSelf: "center" as const,
    fontWeight: "900" as const,
    color: "linear-gradient(120deg,#0095ff 30%,#42d392 100%)" as const,
  };

  return (
    <>
      <text style={textStyle}>linear-direction: column</text>
      <view style={verticalContainerStyle}>
        <view style={redBoxStyle} />
        <view style={yellowBoxStyle} />
        <view style={greenBoxStyle} />
      </view>
      <view style={{ height: "50px" }} />
      <text style={textStyle}>linear-direction: row</text>
      <view style={horizontalContainerStyle}>
        <view style={redBoxStyle} />
        <view style={yellowBoxStyle} />
        <view style={greenBoxStyle} />
      </view>
    </>
  );
};

root.render(<LinearDirection />);

```

v0.11.0



## Syntax

```css
linear-direction: column;

/* Like <column>, but reversed */
linear-direction: column-reverse;

linear-direction: row;

/* Like <row>, but reversed */
linear-direction: row-reverse;
```

### Values

- `column`

  **Default value**. The linear container's main-axis is defined to be the same as vertical direction.

- `row`

  The linear container's main-axis is defined to be the same as the text direction. The main-start and main-end points are the same as the content direction.

- `column-reverse`

  Behaves the same as `column` but the main-start and main-end are opposite to the content direction.

- `row-reverse`

  Behaves the same as `row` but the main-start and main-end points are opposite to the content direction.

- `vertical` deprecated

  Equivalent to `column`.

- `horizontal` deprecated

  Equivalent to `row`.

- `horizontal-reverse` deprecated

  Equivalent to `row-reverse`.

- `vertical-reverse` deprecated

  Equivalent to `column-reverse`.

## Formal definition

| Initial value | column |
| Applies to | linear containers |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
linear-direction = column | row | column-reverse | row-reverse
```

## Differences from the Web

- No such style in Web.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.linear-direction`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/189-linear-direction.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| linear-direction | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| support&#95;linear&#95;direction | Yes (2.2) | Yes (3.4) | Yes (2.2) | Yes (2.2) | Yes (2.2) | Yes |
| support&#95;linear&#95;direction.nested&#95;value&#95;1 | Yes (2.2) | Yes (3.4) | Yes (2.2) | Yes (2.2) | Yes (2.2) | Yes |
| support&#95;linear&#95;direction.nested&#95;value&#95;2 | Yes (2.2) | Yes (3.4) | Yes (2.2) | Yes (2.2) | Yes (2.2) | No |
| support&#95;linear&#95;orientation | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`linear-direction`**

sets how linear items are placed in the linear container defining the main axis and the direction.

**Specifications:**

**`support_linear_direction`**

Support <code>linear-direction</code>

**`support_linear_direction.nested_value_1`**

<code>row</code>, <code>row-reverse</code>, <code>column</code>, <code>column-reverse</code>

**`support_linear_direction.nested_value_2`**

<code>vertical</code>, <code>horizontal</code>, <code>vertical-reverse</code>, <code>horizontal-reverse</code>

**Status:** Deprecated

**`support_linear_orientation`**

Supported <code>linear-orientation</code>

**Status:** Deprecated

