Mosaic
The component for displaying a set of images as tiles in no particular order.
Declaration
object MosaicProperties
| Name | Type | Description |
|---|---|---|
items Required | [GalleryItem] | An array of the images that appear in the mosaic. The order you use in the array may affect layout and positioning in the mosaic, depending on the device or width. Mosaic 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 none value for conditional design elements. Adding it here has no effect. |
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 you don’t define layout, 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 | (ComponentStyle | string | string("none")) | An inline Use the |
Mentioned in
Discussion
Use the Mosaic component to display a group of images in no particular order. (To display a group of images in a particular order, use the Gallery component.) Users can tap an image in a mosaic to see a full-screen version.
[Image]
Example
{
"components": [
{
"role": "title",
"text": "Article Title"
},
{
"role": "body",
"format": "html",
"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": "mosaic",
"items": [
{
"URL": "bundle://mosaic-01.jpg",
"caption": "A caption for the first image in the mosaic."
},
{
"URL": "bundle://mosaic-02.jpg",
"caption": "A caption for the second image in the mosaic."
},
{
"URL": "bundle://mosaic-03.jpg",
"caption": "A caption for the third image in the mosaic."
},
{
"URL": "bundle://mosaic-04.jpg",
"caption": "A caption for the fourth image in the mosaic."
},
{
"URL": "bundle://mosaic-05.jpg",
"caption": "A caption for the fifth image in the mosaic."
}
]
}
]
}