---
updatedAt: 2026-06-23T11:33:10.000Z
agentTools:
  projectIndex: https://docs.zeplin.dev/llms.txt
---

# Layer Constraints

Resizing constraints of the layer relative to its parent

**Type:** object

| Attribute    | Type                | Description                                             |
| ------------ | ------------------- | ------------------------------------------------------- |
| relative\_to | string (*Optional*) | Identifier of the layer the constraints are relative to |
| horizontal   | object (*Optional*) | Horizontal resizing constraint                          |
| vertical     | object (*Optional*) | Vertical resizing constraint                            |

## horizontal

Horizontal resizing constraint

| Attribute    | Type                                                             | Description                                                           |
| ------------ | ---------------------------------------------------------------- | --------------------------------------------------------------------- |
| sizing\_mode | string (`"fixed"`, `"stretch"` or `"hug-contents"`) (*Optional*) | Sizing mode of the layer along the axis                               |
| min          | boolean (*Optional*)                                             | Indicates whether the layer is pinned to the minimum edge of the axis |
| max          | boolean (*Optional*)                                             | Indicates whether the layer is pinned to the maximum edge of the axis |

## vertical

Vertical resizing constraint

| Attribute    | Type                                                             | Description                                                           |
| ------------ | ---------------------------------------------------------------- | --------------------------------------------------------------------- |
| sizing\_mode | string (`"fixed"`, `"stretch"` or `"hug-contents"`) (*Optional*) | Sizing mode of the layer along the axis                               |
| min          | boolean (*Optional*)                                             | Indicates whether the layer is pinned to the minimum edge of the axis |
| max          | boolean (*Optional*)                                             | Indicates whether the layer is pinned to the maximum edge of the axis |

# Example

```json Layer Constraints
{
  "horizontal": {
    "sizing_mode": "stretch"
  },
  "vertical": {
    "sizing_mode": "hug-contents"
  }
}
```