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

# justify-items

APISummary
## Introduction

The CSS `justify-items` property defines the default [`justify-self`](/next/api/css/properties/justify-self.md) for all items of the box, giving them all a default way of justifying each box along the appropriate axis. It aligns the items inside their grid areas on the inline axis.

## Examples

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

**Entry:** `src/justify-items`
**Bundle:** `dist/justify-items.lynx.bundle`

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

const JustifyItems = () => {
  const getGridStyle = (justifyItems: string) => ({
    display: "grid" as const,
    gridTemplateColumns: "auto",
    justifyItems: justifyItems,
  });

  return (
    <>
      <text>justify-items:stretch</text>
      <view style={getGridStyle("stretch")}>
        <text className="item">Item</text>
        <text className="item">Item</text>
      </view>
      <text>justify-items:start</text>
      <view style={getGridStyle("start")}>
        <text className="item">Item</text>
        <text className="item">Item</text>
      </view>
      <text>justify-items:end</text>
      <view style={getGridStyle("end")}>
        <text className="item">Item</text>
        <text className="item">Item</text>
      </view>
      <text>justify-items:center</text>
      <view style={getGridStyle("center")}>
        <text className="item">Item</text>
        <text className="item">Item</text>
      </view>
    </>
  );
};

root.render(<JustifyItems />);

```

v0.11.0



## Syntax

```css
justify-items: stretch;
justify-items: center;
justify-items: start;
justify-items: end;
```

### Values

#### `stretch`

**Default value**. If the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by [`max-height`](/next/api/css/properties/max-height.md)/[`max-width`](/next/api/css/properties/max-width.md) (or equivalent functionality), so that the combined size exactly fills the alignment container.

#### `center`

The items are packed flush to each other toward the center of the alignment container.

#### `start`

The item is packed flush to each other toward the start edge of the alignment container in the appropriate axis.

#### `end`

The item is packed flush to each other toward the end edge of the alignment container in the appropriate axis.

## Formal definition

| Initial value | stretch |
| Applies to | grid containers |
| Inherited | no |
| Animatable |  |


## Formal syntax

```
justify-items = stretch | center | start | end
```

## Differences from the Web

[mdn: justify-items](https://developer.mozilla.org/en/docs/Web/CSS/justify-items)

1. `normal` is not supported. Initial value is `stretch`.
2. `self-start`, `self-end`, `left`, `right`, `flex-start`, `flex-end` are not supported.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.justify-items`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| justify-items | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |

**`justify-items`**

defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis.

**Specifications:**

