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

# order

APISummary
## Introduction

The `order` CSS property sets the order to lay out an item in container. Items in a container are sorted by ascending order value and then by their source code order. Items not given an explicit order value are assigned the default value of `0`.

## Examples

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

**Entry:** `src/order`
**Bundle:** `dist/order.lynx.bundle`

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

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

  const getOrderStyle = (order: number) => ({
    order: order,
  });

  return (
    <view className="intro" style={containerStyle}>
      <text className="intro-item" style={getOrderStyle(1)}>order: 1</text>
      <text className="intro-item" style={getOrderStyle(3)}>order: 3</text>
      <text className="intro-item" style={getOrderStyle(2)}>first order: 2</text>
      <text className="intro-item" style={getOrderStyle(2)}>second order: 2</text>
    </view>
  );
};

root.render(<Order />);

```

v0.11.0



## Syntax

```css
/* Numerical value including negative numbers */
order: 5;
order: -5;
```

### Values

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

Represents the ordinal group to be used by the item. Default value is `0`.

## Formal definition

| Initial value | 0 |
| Applies to | child element with[`position: relative`](/next/api/css/properties/position) |
| Inherited | no |
| Animatable | no |


## Differences from the Web

1. It is not supported to use on [`position: absolute/fixed/sticky`](/next/api/css/properties/position.md) flex and grid container children.
2. Using `order` will not influence the element's painting order in Lynx.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.order`

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

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

**`order`**

The order CSS property sets the order to lay out an item.

**Specifications:**

