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

# Adding a Divider

Create a horizontal, styled divider that extends to the right edge of the display.

## Discussion

In <doc://com.apple.applenews/documentation/AppleNews/creating-your-first-article>, you added some text components to your article. Now, you can add a `divider` component to visually separate some text components and create color contrast.

**On this page, you’ll learn how to create a horizontal dividing line that extends to the right edge of the display.**

![Screenshot of an Apple News article with a divider on iPad. The divider’s left edge is aligned to article text and its right edge extends all the way to the edge of the display.](images/com.apple.applenews/media-3624431@2x.png)

### Define a ComponentLayout Object that Bleeds to the Right Edge

Before you can make your divider line extend to the right edge of the display, you must define a new `ComponentLayout` object that uses the `ignoreDocumentMargin` property.

1. Copy the example code <doc://com.apple.applenews/documentation/AppleNews/adding-a-divider#bigDividerLayout-Copy-This-Code>.
2. Paste the code inside your `ArticleDocument.componentLayouts` object, after the closing brace (`}`) of the last `ComponentLayout` object and before the closing brace for the whole `componentLayouts` property.

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

#### bigDividerLayout: Copy This Code

```json
,
    "bigDividerLayout": {
      "ignoreDocumentMargin": "right",
      "columnStart": 0,
      "columnSpan": 20,
      "margin": {
        "top": 6,
        "bottom": 6
      }
    }
```

#### bigDividerLayout: Result

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

```json
{
  ...
  "componentLayouts": {
    ...
    "bigDividerLayout": {
      "ignoreDocumentMargin": "right",
      "columnStart": 0,
      "columnSpan": 20,
      "margin": {
        "top": 6,
        "bottom": 6
      }
    }
  },
  ...
}
```

### Add a Divider in Your Article

A `divider` component in your JSON file represents a divider line in your article.

1. Copy the example code <doc://com.apple.applenews/documentation/AppleNews/adding-a-divider#Divider-Copy-This-Code>.
2. Paste the code inside the `components` array of your article, after the closing brace and comma (`},`) that end `heading1` component.

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

After you make this change in your code, you can preview your working `article.json` file in News Preview to see a yellow divider.

#### Divider: Copy This Code

```json
    {
      "role": "divider",
      "layout": "bigDividerLayout",
      "stroke": {
        "width": 3,
        "color": "#D5B327"
      }
    },
```

#### Divider: Result

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

```json
{
  ...
  "components": [
    ...
    {
      "role": "divider",
      "layout": "bigDividerLayout",
      "stroke": {
        "width": 3,
        "color": "#D5B327"
      }
    },
    ...
  ],
  ...
}
```

### Further Exploration

At any time, you can try changing property values in your `article.json` file and then use News Preview to see how these changes affect the look of your article.

For example, try changing the layout of your article’s `divider` component:

1. In your `article.json` file, find the `ComponentLayout` object called `bigDividerLayout`.
2. In `bigDividerLayout`, find the `ignoreDocumentMargin` property and replace its value (`"right"`) with `"both"`.
3. Preview your `article.json` file in News Preview.

The divider now ignores the margins on both sides of the document.

### Previous

<doc://com.apple.applenews/documentation/AppleNews/positioning-text-components>

### Next

<doc://com.apple.applenews/documentation/AppleNews/adding-an-image-and-captions>

## See Also

[`object Divider`](/documentation/AppleNewsFormat/Divider)

The component for defining a horizontal line to visually divide parts of your article.

[`object ComponentLayout`](/documentation/AppleNewsFormat/ComponentLayout)

The object for defining the positioning for a specific component within the article’s column system.

[`object StrokeStyle`](/documentation/AppleNewsFormat/StrokeStyle)

The object for defining the color, width, and style of a border or divider.



---

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)