Contents

GalleryItem

An object used in a gallery or mosaic component for displaying an individual image.

Declaration

object GalleryItem

Properties

NameTypeDescription
URL Requireduri

The URL of an image to display in a gallery or mosaic.

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.

Encode image filenames as URLs.

See Preparing Image, Video, Audio, Music, and ARKit Assets.

accessibilityCaptionstring

A caption that describes the image. The text is used for VoiceOver. For more information about VoiceOver, see the Vision page in Accessibility. If you don’t provide accessibilityCaption, VoiceOver uses the caption value.

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 accessibilityCaption text. For more information about VoiceOver, see the Vision page in Accessibility. The caption text doesn’t appear in the main article view. To display a caption in the main article view, use the Caption component.

explicitContentboolean

A Boolean value that indicates the image may contain explicit content.

Mentioned in

Discussion

Use an array of GalleryItem objects to define the individual items used in a gallery or mosaic component. When the user taps an image in a gallery or mosaic to see it full-screen (as shown in the following figure), the caption from the caption descriptor property is shown. Note that this is different from the Caption component.

[Image]

This object can be used in Gallery and Mosaic.

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
        }
      ]
    }
  ]
}

See Also

Related Documentation

Galleries and Mosaics