Section
The component for organizing an article into sections.
Declaration
object SectionProperties
| Name | Type | Description |
|---|---|---|
role Required | string | Always |
additions | [ComponentLink] | An array of 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. |
allowAutoplacedAds | boolean | A Boolean value that allows the placement of ad banners between components. Nested components inherit the value of the outermost container that explicitly sets |
anchor | Anchor | 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 |
behavior | (Behavior | string("none")) | An object that defines behavior for a component, like Parallax or Springy. The |
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 In versions of News prior to iOS 11, child components are positioned as if The |
hidden | boolean | A Boolean value that determines whether the component is hidden. |
identifier | string | An optional unique identifier for this component. If used, this |
layout | (ComponentLayout | string) | An inline If |
scene | Scene | A set of animations applied to any |
style | (ComponentStyle | string | string("none")) | An inline The |
Mentioned in
Discussion
A section 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. You can also use the section component to divide large chapters.
The section 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 section is determined by the height of its child components.
Example
{
"components": [
{
"role": "section",
"components": [
{
"role": "header",
"style": {
"fill": {
"type": "image",
"URL": "bundle://header.jpg",
"fillMode": "cover",
"verticalAlignment": "top",
"horizontalAlignment": "center"
}
},
"layout": {
"minimumHeight": "75cw"
},
"components": [
{
"role": "title",
"text": "Article Title",
"anchor": {
"targetAnchorPosition": "center"
},
"textStyle": {
"textAlignment": "center"
}
}
]
}
]
}
]
}