Contents

Chapter

The component for organizing an article into chapters.

Declaration

object Chapter

Properties

NameTypeDescription
role Requiredstring

Always chapter for this component.

additions[ComponentLink]

An array of ComponentLink objects you can use to create a ComponentLink, allowing a link to anywhere in News.

You can add a link to a Container component to make the entire component tappable. Any links used in its child components are not interactable.

allowAutoplacedAdsboolean

A Boolean value that allows the placement of ad banners between components. Nested components inherit the value of the outermost container that explicitly sets allowAutoplacedAds. The default value is true.

anchorAnchor

An object that defines vertical alignment with another component.

animation(ComponentAnimation | string("none"))

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(Behavior | string("none"))

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.

components[Component]

An array of components to display as child components. Child components are positioned and rendered relative to their parent component.

conditional(ConditionalSection | [ConditionalSection])

An instance or array of section properties that can be applied conditionally, and the conditions that cause Apple News Format to apply them.

contentDisplay(CollectionDisplay | HorizontalStackDisplay | string("none"))

An object that defines how to position child components within this chapter component. A HorizontalStackDisplay, for example, allows for displaying child components side by side.

In versions of News prior to iOS 11, child components are positioned as if contentDisplay were not defined.

The none value is used for conditional design elements. Adding it here has no effect.

hiddenboolean

A Boolean value that determines whether the component is hidden.

identifierstring

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(ComponentLayout | string)

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.

If layout is not defined, size and position are based on various factors, such as the device type, the length of the content, and the role of this component.

sceneScene

A set of animations applied to any header component that is a child of this chapter.

style(ComponentStyle | string | string("none"))

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

Discussion

A chapter is a full-width container component that lets you nest components so you can divide a large article into separate parts with potentially different styling. The chapter component is a structural component intended to organize an entire article, so you generally use it in the components array in the ArticleDocument properties. The overall height of a chapter is determined by the height of its child components.

Example

{
  "components": [
    {
      "role": "chapter",
      "components": [
        {
          "role": "quote",
          "text": "The squall! the squall! jump, my jollies! (<i>They scatter.</i>)",
          "format": "html"
        }
      ]
    }
  ]
}

See Also

Related Documentation

Article Structure