---
title: FlexibleSpacer
framework: applenewsformat
role: symbol
role_heading: Object
path: applenewsformat/flexiblespacer
---

# FlexibleSpacer

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

## Declaration

```data
object FlexibleSpacer
```

## Properties

role: Always spacer for this object. anchor: An object that defines vertical alignment with another component. animation: An object that defines an animation you apply to the component. Use the none value for conditional design elements. Adding it here has no effect. behavior: An object that defines behavior for a component, like Parallax or Springy. The none value is used for conditional design elements. Adding it here has no effect. conditional: An instance or array of component properties that can be applied conditionally,  and the conditions that cause Apple News Format to apply them. hidden: A Boolean value that determines whether the component is hidden. identifier: An optional unique identifier for this component. If used, this identifier must be unique across the entire document. You will need an identifier for your component if you want to anchor other components to it. layout: An inline ComponentLayout object that contains layout information, or a string reference to a ComponentLayout object that is defined at the top level of the document. The width of the spacer is determined automatically based on any remaining horizontal space, and the height is that of the parent container. Any top or bottom margins specified on a spacer component’s layout decreases the height of the layout within the parent container. All properties of ComponentLayout object are supported except minimumHeight and minimumWidth. style: An inline ComponentStyle object that defines the appearance of this component, or a string reference to a ComponentStyle object that is defined at the top level of the document. The none value is used for conditional design elements. Adding it here has no effect.

## Mentioned in

Displaying Components Side By Side

## Discussion

Discussion Use the FlexibleSpacer object to redistribute the extra space between child components in a 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 {   "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](applenewsformat/component.md)

## See Also

### Article Structure

- [Nesting Components in an Article](applenews/nesting-components-in-an-article.md)
- [Adding a Scene to a Chapter or a Section Header](applenews/adding-a-scene-to-a-chapter-or-a-section-header.md)
- [Creating an Article Link](applenews/creating-an-article-link.md)
- [Displaying Components Side By Side](applenews/displaying-components-side-by-side.md)
- [Header](applenewsformat/header.md)
- [Container](applenewsformat/container.md)
- [Section](applenewsformat/section.md)
- [Chapter](applenewsformat/chapter.md)
- [Aside](applenewsformat/aside.md)
- [CollectionDisplay](applenewsformat/collectiondisplay.md)
- [HorizontalStackDisplay](applenewsformat/horizontalstackdisplay.md)
- [Divider](applenewsformat/divider.md)
- [ArticleLink](applenewsformat/articlelink.md)
- [SupportedArticleIdentifier](applenewsformat/supportedarticleidentifier.md)
- [PublisherArticleIdentifier](applenewsformat/publisherarticleidentifier.md)
