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

# ImageFill

The object for adding an image background fill to a component.

```
object ImageFill
```

## Discussion

Use the `ImageFill` object to fill a component with a background image.

To avoid having the image cut off on different devices, calculate the minimum height needed for the image. For example, the following shows the minimum height calculation of a full display based on an image with dimensions 2184 x 1456 pixels:

100 * (height / width) + “cw”

100 * (1456 / 2184) + “cw”

“66.67cw”

For more information about the use of `cw`, see <doc://com.apple.applenews/documentation/AppleNews/specifying-measurements-for-components>.

> Note:
> The image fill doesn’t open as a full-screen version when tapped.

You can use this object in [`ComponentStyle`](/documentation/AppleNewsFormat/ComponentStyle).

### Create a Layered Effect with a Background

You can create a layered or collage effect by using a background image with a header container component. Create a header that contains the other components you want in the top section of your article, such as the `title` and `intro`, and then apply a background image to the `header` component. All content in the `header` component appears in front of the background, creating a layered effect.

### Set a Fixed Image Fill

One of the most captivating effects in Apple News Format is the fixed image fill. With this background, the image stays still as a person scrolls, with the rest of the content in the article seeming to move independently of the image. As long as any part of the component containing the image is visible in the viewport, the image remains still.

To create this effect, use a [`ComponentStyle`](/documentation/AppleNewsFormat/ComponentStyle) object with `image` as the `fill` type, and then give the `attachment` property the value of `fixed`.

![Screenshot of an Apple News article with a fixed image fill on iPad.](images/com.apple.applenews/media-3597901@2x.png)

> Tip:
> Use structural container components (such as `header`, `section`, and `container`) to have more control over backgrounds in your article. For example, you can specify backgrounds for the components inside the container as well as for the container itself.

### Example

```json
{
  "components": [
    {
      "role": "container",
      "style": "exampleComponentStyle",
      "layout": {
        "minimumHeight": 150
      },
      "components": [
        {
          "role": "title",
          "text": "Drought",
          "anchor": {
            "targetAnchorPosition": "center"
          },
          "textStyle": {
            "fontSize": 60
          }
        }
      ]
    }
  ],
  "componentStyles": {
    "exampleComponentStyle": {
      "fill": {
        "type": "image",
        "URL": "bundle://image.jpg",
        "fillMode": "cover",
        "verticalAlignment": "top"
      }
    }
  }
}
```

## See Also

  <doc://com.apple.applenews/documentation/AppleNews/creating-a-layered-header>

  <doc://com.apple.applenews/documentation/AppleNews/adding-a-fixed-image-fill>

## Relationships

### Inherits From

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

---

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)