Photo
The component for including a photograph.
Declaration
object PhotoProperties
| Name | Type | Description |
|---|---|---|
URL Required | uri | The URL of an image file. Image URLs can begin with Encode image filenames as URLs. |
role Required | string | Always |
accessibilityCaption | string | A caption that describes the photo. VoiceOver uses this text. For more information about VoiceOver, see the Vision page in Accessibility. If you don’t provide |
additions | [ComponentLink] | An array of |
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. 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 value that indicates the image may contain explicit content. |
hidden | boolean | A Boolean value that determines whether the component is hidden. |
identifier | string | An optional unique identifier for this component. If you use |
layout | (ComponentLayout | string) | An inline If you don’t define |
style | (ComponentStyle | string | string("none")) | An inline Use the |
Mentioned in
Discussion
Use the photo component to display a photograph in an article. A photo component is optimized for displaying photographs. Other components are available for other types of images, such as Figure, Portrait, and Logo.
See Preparing Image, Video, Audio, Music, and ARKit Assets.
Example
{
"components": [
{
"role": "title",
"text": "Apple News Format"
},
{
"role": "body",
"text": "Apple News Format allows publishers to craft beautiful editorial layouts. Galleries, audio, video, and fun interactions like animation make stories spring to life."
},
{
"role": "photo",
"URL": "bundle://image.jpg"
}
]
}