<!--
{
  "documentType" : "article",
  "framework" : "AppleNews",
  "identifier" : "/documentation/AppleNews/adding-animations",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Adding Animations"
}
-->

# Adding Animations

Use animations to affect how parts of your article come into view the first time they appear.

## Discussion

**On this page, you’ll learn how to apply animations to components.**

The images below display some animations. In the first image, the pull quote gets larger and darker as the user scrolls through the text. In the second image, the photo gets darker, but not larger, as the user scrolls. In the third image, the gallery moves in from the right side of the screen.

![Side-by-side screenshots of an Apple News article on iPhone showing the effect of scrolling with a scale fade animation.](images/com.apple.applenews/media-3625689@2x.png)

![Side-by-side screenshots of an Apple News article on iPhone showing the effect of scrolling with a fade-in animation.](images/com.apple.applenews/media-3625691@2x.png)

![Side-by-side screenshots of an Apple News article on iPhone showing the effect of scrolling with a move-in animation.](images/com.apple.applenews/media-3625690@2x.png)

### Create Animations

1. Copy the example code <doc://com.apple.applenews/documentation/AppleNews/adding-animations#Scale-Fade-Animation-Copy-This-Code>.
2. Paste the code inside the `pullquote` component in your `article.json` file, after the closing quotation mark that ends the `text` property.
3. Copy the example code <doc://com.apple.applenews/documentation/AppleNews/adding-animations#Move-In-Animation-Copy-This-Code>.
4. Paste the code inside the `gallery` component in your `article.json` file, after the comma that ends the `layout` property.
5. Copy the example code <doc://com.apple.applenews/documentation/AppleNews/adding-animations#Fade-In-Animation-Copy-This-Code>.
6. Paste the code inside the `photo` component in your `article.json` file, after the closing quotation mark that ends the `caption` property.

Your code should look like the example code <doc://com.apple.applenews/documentation/AppleNews/adding-animations#Animations-Result>.

After you make these changes in your code, you can preview your working `article.json` file in News Preview to see the animations.

#### Scale Fade Animation: Copy This Code

```json
,
              "animation": {
                "type": "scale_fade",
                "userControllable": true,
                "initialAlpha": 0.5,
                "initialScale": 0.75
              }
```

#### Move-In Animation: Copy This Code

```json
          "animation": {
            "type": "move_in",
            "preferredStartingPosition": "right"
          },
```

#### Fade-In Animation: Copy This Code

```json
,
              "animation": {
                "type": "fade_in",
                "userControllable": true,
                "initialAlpha": 0.5
              }
```

#### Animations: Result

Ellipses (`...`) indicate lines of code that have been omitted from this example.

```json
{
  ...
  "components": [
    ...
    {
      "role": "section",
      ...
      "components": [
        ...
        {
          "role": "container",
          ...
          "components": [
            {
              "role": "pullquote",
              "format": "html",
              "layout": "halfMarginAboveQuarterBelowContainedLayout",
              "text": "“QUIA CONSEQUUNTUR MAGNI DOLORES EOS <span data-anf-textstyle='mediumGrayText'>QUI RATIONE VOLUPTATEM SEQUI NESCIUNT.”</span>",
              "animation": {
                "type": "scale_fade",
                "userControllable": true,
                "initialAlpha": 0.5,
                "initialScale": 0.75
              }
            },
            ...
          ]
        },
        ...
        {
          "role": "gallery",
          "layout": "noMarginLayout",
          "animation": {
            "type": "move_in",
            "preferredStartingPosition": "right"
          },
          "items": [
            ...
          ]
        },
        ...
        {
          "role": "container",
          ...
          "components": [
            {
              "role": "photo",
              "layout": "halfMarginAboveContainedLayout",
              "URL": "bundle://sidebar.jpg",
              "caption": "A caption for the sidebar photo.",
              "animation": {
                "type": "fade_in",
                "userControllable": true,
                "initialAlpha": 0.5
              }
            },
            ...
          ]
        },
        ...
      ]
    }
  ],
  ...
}
```

### Previous

<doc://com.apple.applenews/documentation/AppleNews/adding-color-to-text-ranges>

### Next

<doc://com.apple.applenews/documentation/AppleNews/adding-a-scene>

## See Also

  <doc://com.apple.applenews/documentation/AppleNews/about-component-animations>



---

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)