Gallery
The component for displaying a sequence of images in a specific order as a horizontal strip.
Declaration
object GalleryProperties
| Name | Type | Description |
|---|---|---|
items Required | [GalleryItem] | An array of the images that appear in the gallery. The order you use in the array is the order of the images in the gallery. Gallery items can be JPEG (with |
role Required | string | Always |
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 |
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. |
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 |
style | (ComponentStyle | string | string("none")) | An inline Use the |
Mentioned in
Discussion
Use the Gallery component for sequences of images where the ordering of the items is important to the story. To display images in no specific order, use the Mosaic component. People can swipe to view the images in a gallery as shown in this example:
[Image]
Example
{
"components": [
{
"role": "gallery",
"items": [
{
"URL": "bundle://gallery-01.jpg",
"caption": "Thanks to the record drought, mountain lions have begun to descend from the peaks, sometimes into urban settings."
},
{
"URL": "bundle://gallery-02.jpg",
"caption": "Coyotes are also seen in cities more often."
},
{
"URL": "bundle://gallery-03.jpg",
"explicitContent": true
}
]
}
]
}