ArticleLink
The container component for creating a link to an article.
Declaration
object ArticleLinkProperties
| Name | Type | Description |
|---|---|---|
articleIdentifier | (SupportedArticleIdentifier | PublisherArticleIdentifier) | The shareable URL or CloudKit ID of an article that is navigated to, and that is used as the default title and thumbnail. If |
role Required | string | Always |
additions | [ComponentLink] | An array of
Any link additions defined here or in any of the child components (ArticleTitle and ArticleThumbnail) have no effect. |
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 | (ConditionalContainer | [ConditionalContainer]) | An instance or array of container 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 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. See Anchor. |
layout | (ComponentLayout | string) | An inline If |
style | (ComponentStyle | string | string("none")) | An inline The |
Mentioned in
Discussion
Use the ArticleLink component to link a user to the article specified using the articleIdentifier property. If no articleIdentifier is provided, the component is assumed to be self referencing. Use ArticleThumbnail and ArticleTitle as child components instead of Image or Text to provide semantic value to the linked article. You can use these components to provide content, styling, and layout, like you do with any other Apple News Format component. Apple News automatically populates the content based on nested child elements. A ComponentAddition is automatically added to the component to allow the user to navigate to the referenced article.
Example
{
"components": [
{
"role": "article_link",
"articleIdentifier": "https://apple.news/AT6kNQslCQy6EE4bF8hpOoQ",
"components": [
{
"role": "article_thumbnail",
"aspectRatio": 1,
"fillMode": "cover",
"verticalAlignment": "top"
},
{
"role": "article_title"
}
]
}
]
}