Contents

CaptionDescriptor

The object you use in image components for displaying captions when the image is full-screen.

Declaration

object CaptionDescriptor

Properties

NameTypeDescription
text Requiredstring

The text to display in the caption, including any formatting tags or markup, depending on the format property.

additions[Addition]

An array of Link objects that provide additional information for ranges of the caption text in the text property.

If you set format to html or markdown, Apple News Format doesnʼt support Additions or InlineTextStyles.

formatstring

The formatting or markup method applied to the text.

If you set format to html or markdown, Apple News Format doesn’t support Additions or InlineTextStyles.

inlineTextStyles[InlineTextStyle]

An array of InlineTextStyle objects you apply to ranges of the caption’s text.

Apple News Format ignores InlineTextStyles when format is set to html or markdown.

textStyle(ComponentTextStyle | string)

An inline ComponentTextStyle object that contains styling information, or a string reference to a component text style object that you define at the top level of the document.

Mentioned in

Discussion

Use a CaptionDescriptor object to provide a caption or attribution for an image that’s displayed full screen. You can use a caption descriptor with a Figure, Portrait, or Photo component, and also with the individual items in a Gallery or Mosaic component.

You can use this object in Figure, Portrait, Photo, and Gallery Item.

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",
          "caption": {
            "text": "<i>Steenbok</i> typically lie low in vegetation cover at the first sign of threat.",
            "format": "html"
          }
        }
      ]
    }
  ]
}

See Also

Related Documentation

Images