<!--
{
  "availability" : [
    "Apple News Format: 1.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleNewsFormat",
  "identifier" : "/documentation/AppleNewsFormat/FlexibleSpacer",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Apple News Format"
    ],
    "preciseIdentifier" : "data:news_format:FlexibleSpacer"
  },
  "title" : "FlexibleSpacer"
}
-->

# FlexibleSpacer

The component for redistributing empty space inside a horizontal stack collection.

```
object FlexibleSpacer
```

## Discussion

Use the `FlexibleSpacer` object to redistribute the extra space between child components in a [`HorizontalStackDisplay`](/documentation/AppleNewsFormat/HorizontalStackDisplay).  Otherwise, if you have two child components in a horizontal stack that don’t use up all of the space, the extra space is always on the right side. The `FlexibleSpacer` object does not have an intrinsic size, but is sized to fit any remaining width, and to fit the height of the parent container. The object is ignored when used outside of the `HorizontalStackDisplay` context.

### Example

```json
{
  "components": [
    {
      "role": "container",
      "components": [
        {
          "role": "image",
          "URL": "bundle://summer.jpg",
          "layout": {
            "minimumWidth": "60cw",
            "maximumWidth": "60cw"
          }
        },
        {
          "role": "spacer"
        },
        {
          "role": "image",
          "URL": "bundle://winter.jpg",
          "layout": {
            "minimumWidth": "35cw",
            "maximumWidth": "35cw"
          }
        }
      ],
      "contentDisplay": {
        "type": "horizontal_stack"
      }
    }
  ]
}
```

## Relationships

### Inherits From

[`Component`](/documentation/AppleNewsFormat/Component)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)