Object

Component

Properties shared by all component types.

Properties

role
string
(Required)

The role of a component (for example, title, body, or pullquote) conveys the semantic value of the content or its function within the article.

The value of the role property is simply the role name; it does not include the actual content that the role describes. For example, a role with the value pullquote would describe a text component whose value is the actual pull quote text.

A role can have design significance: styling and layout can be derived from it. The role is also used by VoiceOver for iOS and VoiceOver for macOS to make Apple News content more accessible.

For a list of valid component types, see Components.

anchor

An object that defines vertical alignment with another component.

animation
*

An object that defines an animation to be applied to the component.

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

behavior
*

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.

conditional
*

An instance or array of component properties that can be applied conditionally, and the conditions that cause them to be applied.

hidden
boolean

A Boolean value that determines whether the component is hidden.

identifier
string

A unique identifier for this component. If used, identifier must be unique across the entire document. An identifier is required if you want to anchor other components to this component.

layout
*

An inline ComponentLayout object that contains layout information, or a string reference to a ComponentLayout 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.

style
*

An inline ComponentStyle object that defines the appearance of this component, or a string reference to a ComponentStyle 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.

Discussion

In Apple News Format, every component has a property named role that conveys the component’s semantic value and its function in the article. For example, a role property that has a value of body indicates a body component, which means that its content will be part of the article’s body text. A component whose role property has a value of photo represents one of the images in the article.

This object can be used in ArticleDocument and Container.

See Also

First Steps

Adding Components

Learn the basics for adding components to your article.