Photo Caption


The Alexa photo caption responsive component (AlexaPhotoCaption) displays text to provide context to an image. For example, the Alexa photo (AlexaPhoto) responsive template uses AlexaPhotoCaption to display text with an image.

Compatibility

AlexaPhotoCaption is designed to work with the following viewport profiles:

  • The following widget viewport profiles in the alexa-viewport-profiles package:
    • Widget Medium (@hubWidgetMedium)
  • All standard viewport profiles in the alexa-viewport-profiles package:
    • All hub round profiles
    • All hub landscape profiles
    • All hub portrait profiles
    • All mobile profiles
    • All TV profiles

For details about viewport profiles, see Viewport Profiles.

If you use AlexaPhotoCaption on an unsupported viewport, you might have unexpected results.

Import the alexa-layouts package

To use AlexaPhotoCaption, import the alexa-layouts package.

The latest version of the alexa-layouts package is 1.7.0. AlexaPhotoCaption was introduced in version 1.5.0.

AlexaPhotoCaption parameters

The following table shows the parameters you can set on AlexaPhotoCaption. Unless otherwise noted, standard viewport profiles support all parameters. The "Widget support" column indicates the widget viewport profiles that support each parameter. For details about viewport profiles, see Viewport Profiles.

All parameters except type are optional.

Name Type Default Description Widget support Version added

layoutDirection

String

inherit

Specifies the layout direction for the content. Set this property to either LTR (left-to-right) or RTL (right-to-left). When not set, this property inherits the layoutDirection specified in the parent component.

For details about support for right-to-left languages in the responsive components, see Support for Right-to-left Languages.

Medium

1.5.0

primaryText

String

Primary text for the caption, displayed in a single line.

Medium

1.5.0

secondaryText

String

Secondary text for the caption, displayed in a single line below the primaryText.

Medium

1.5.0

type

String

Always set to AlexaPhotoCaption

Medium

1.5.0

AlexaPhotoCaption example



Was this page helpful?

Last updated: Dec 06, 2023