ArticleThumbnail
The component for displaying a thumbnail image with an article link.
Declaration
object ArticleThumbnailProperties
| Name | Type | Description |
|---|---|---|
role Required | string | Always |
accessibilityCaption | string | A caption that describes the image. VoiceOver uses this text. For more information about VoiceOver, see the Vision page in Accessibility. If you don’t provide |
additions | [ComponentLink] | Ignored for all subcomponents of ArticleLink. |
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 |
articleIdentifier | string | The identifier of the article that this component displays the thumbnail of. By default the |
aspectRatio | float | The aspect ratio of the component in which the article thumbnail is displayed. |
behavior | (Behavior | string("none")) | An object that defines behavior for a component, like Parallax or Springy. Use the |
caption | (CaptionDescriptor | string) | A caption that describes the image. The article displays this text when the image is full screen, and VoiceOver uses this text if you don’t provide |
conditional | (ConditionalComponent | [ConditionalComponent]) | An instance or array of component properties that you can apply conditionally, and the conditions that cause Apple News Format to apply them. |
explicitContent | boolean | A Boolean that indicates that the image may contain explicit content. |
fillMode | string | A string that indicates how to display the image fill. Valid values:
|
hidden | boolean | A Boolean that indicates whether the component is hidden. |
horizontalAlignment | string | A string that sets the horizontal alignment of the image fill within its component. Valid values:
You can use |
identifier | string | A unique identifier for this component. If you use identifier, it must be unique across the entire document. Apple News requires an identifier if you want to anchor other components to this component. See Anchor. |
layout | (ComponentLayout | string) | An inline If you don’t define |
style | (ComponentStyle | string | string("none")) | An inline Use the |
URL | uri | The URL of an image file. If omitted, the thumbnail of the article referenced in the ArticleLink component is used. Images should be high-resolution so they can be smoothly scaled down. Image URLs can begin with http://, https://, or bundle://. If the image URL begins with bundle://, the image file must be in the same directory as the document. Image filenames should be properly encoded as URLs. |
verticalAlignment | string | A string that defines the vertical alignment of the article thumbnail within the component. |
Mentioned in
Discussion
Use the ArticleThumbnail object to display the thumbnail of an article. Use this component inside an ArticleLink component. The value of the URL property is automatically populated to reference the thumbnail image associated with the article (using the articleIdentifier property of the ArticleLink component). To provide a custom thumbnail, use another component, such as Image.
Example
{
"components": [
{
"role": "article_link",
"articleIdentifier": "https://apple.news/AT6kNQslCQy6EE4bF8hpOoQ",
"components": [
{
"role": "article_thumbnail",
"aspectRatio": 1,
"fillMode": "cover",
"verticalAlignment": "top"
},
{
"role": "article_title"
}
]
}
]
}