Image Caption (Widget) (1.6.0)
(This is not the most recent version of AlexaImageCaption
. Use the Other Versions option to see the documentation for the most recent version of AlexaImageCaption
)
The Alexa image caption template AlexaImageCaption
displays an image with a header and caption. You can specify the caption text as primary and secondary text. The template can display the caption over the image, or display the caption in a solid color box below the image.
Compatibility
AlexaImageCaption
is designed to work with the following widget viewport profiles in the alexa-viewport-profiles
package:
- Widget Medium (
@hubWidgetMedium
)
If you use AlexaImageCaption
on an unsupported viewport, you might have unexpected results. For details about viewport profiles, see Viewport Profiles.
Import the alexa-layouts package
To use AlexaImageCaption
, import the alexa-layouts package.
The latest version of the alexa-layouts
package is 1.7.0. AlexaImageCaption
was introduced in version 1.5.0.
AlexaImageCaption parameters
The following table shows the AlexaImageCaption
properties that work with the widget viewport profiles. Not all parameters apply to all viewport profiles. 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
, imageSource
, and primaryText
are optional.
Name | Type | Default | Description | Widget support | Version added |
---|---|---|---|---|---|
|
String |
— |
A string describing the footer action button. Voice over reads this string when the user selects the button. Applies when |
Medium |
1.5.0 |
|
String |
— |
URL for attribution image source. The image displays below the |
Medium |
1.5.0 |
|
String |
|
The style to use for the footer action button. Applies when |
Medium |
1.5.0 |
|
String |
— |
When provided, include a footer action button with the specified text. This text should indicate the purpose of the button. When not set, |
Medium |
1.5.0 |
|
Array |
— |
Array of |
Medium |
1.5.0 |
|
String |
— |
Primary text to render in the header. |
Medium |
1.5.0 |
|
Boolean |
|
When |
Medium |
1.5.0 |
|
Boolean |
|
When |
Medium |
1.5.0 |
|
String |
— |
Uniform Resource Identifier (URI) for the image to display. |
Medium |
1.5.0 |
|
String |
|
The language for the text displayed in the template. This language determines the default font used for the text. For example, when set to |
Medium |
1.5.0 |
|
String |
|
Specifies the layout direction for the content. Set this property to either |
Medium |
1.5.0 |
|
Array of commands |
— |
The action to trigger when the user selects the footer action button. Applies when |
Medium |
1.5.0 |
|
String |
— |
Primary text to display. |
Medium |
1.5.0 |
|
String |
— |
Secondary text to display below the |
Medium |
1.5.0 |
|
String |
|
Set the dark or light color theme. The selected theme controls the colors used for the component. |
Medium |
1.5.0 |
|
Boolean |
|
When |
Medium |
1.5.0 |
AlexaImageCaption example
The following example shows AlexaImageCaption
with imageScrim
set to true
. This example also includes attributionImage
. Therefore, the secondaryText
doesn't display.
The following example shows AlexaImageCaption
with imageScrim
set to false
. The text displays in a solid colored box below the image. The example doesn't include attributionImage
. Therefore, a single line of secondaryText
displays.
Related topics
Last updated: Nov 28, 2023