Detail (1.6.0)
(This is not the most recent version of AlexaDetail
. Use the Other Versions option to see the documentation for the most recent version of AlexaDetail
)
The Alexa detail template (AlexaDetail
) displays text and an image to present information about an entity such as a person, place, or thing. AlexaDetail
includes four variants: Generic, Movies and TV, Location, and Recipe. Use AlexaDetail
for long-form structured content with a short voice synopsis.
This is a full-screen template that can include a header, footer, and background.
Compatibility
AlexaDetail
is designed to work with 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
If you use AlexaDetail
on an unsupported viewport, you might have unexpected results. For details about viewport profiles, see Viewport Profiles.
Import the alexa-layouts package
To use AlexaDetail
, import the alexa-layouts package.
The latest version of the alexa-layouts
package is 1.7.0. AlexaDetail
was introduced in version 1.2.0.
AlexaDetail parameters
All parameters except type
are optional. AlexaDetail
has multiple different layouts for different types of content. Not all properties apply to all of the different layouts. For more information about the different layouts, see AlexaDetail content types and layouts.
Name | Type | Default | Description | Widget support | Version added |
---|---|---|---|---|---|
|
String |
|
Image/video alignment to apply to background image/video. Defaults to center. |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
— |
Color to use as a background color. Used when neither |
Not supported |
1.2.0 | |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
— |
URL for the background image source. Used when |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
|
Image or video scaling to apply to background image or video. Defaults to |
Not supported |
1.2.0 |
|
String |
|
Audio track to play on when playing the video. Can be |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
— |
The background video source. Provide a source in the same format shown for the |
Not supported |
1.2.0 | |
|
String |
— |
The main body text to display. Since the entire layout scrolls, the body text can be long. This property is ignored when |
Not supported |
1.2.0 |
|
String |
|
A string describing button 1. Voice over reads this string when the user selects the button. |
Not supported |
1.2.0 |
|
— |
The action to trigger when the user selects button 1. |
Not supported |
1.2.0 | |
|
String |
|
The style to use for button 1. Set to |
Not supported |
1.2.0 |
|
String |
— |
The text to display on button 1. Button text should indicate the purpose of the button. Leave this property not set to remove button 1 from the layout. When both |
Not supported |
1.2.0 |
|
String |
|
Color theme to use for button 1. Set to |
Not supported |
1.2.0 |
|
String |
|
A string describing button 2. Voice over reads this string when the user selects the button. |
Not supported |
1.2.0 |
|
— |
The action to trigger when the user selects button 2. |
Not supported |
1.2.0 | |
|
String |
|
The style to use for button 2. Set to |
Not supported |
1.2.0 |
|
String |
— |
The text to display on button 2. Button text should indicate the purpose of the button. Leave this property not set to remove button 2 from the layout. When both |
Not supported |
1.2.0 |
|
String |
|
Color theme to use for button 2. Set to |
Not supported |
1.2.0 |
|
String |
|
Determines the placement of the image on viewports wide enough to show the image and content side-by-side. Set to |
Not supported |
1.2.0 |
|
String |
|
Specifies the type of layout to display. Set to one of the following: |
Not supported |
1.2.0 |
|
Any |
|
The graphic to display to represent an 'empty' rating slot (such as an empty star). Used when |
Not supported |
1.2.0 |
|
Array |
— |
Array of entity data to bind to this template. |
Not supported |
1.2.0 |
|
String |
|
Voice over will read this string when the user selects external link button. |
Not supported |
1.6.0 |
|
— |
The action to trigger when the user selects the external link button. |
Not supported |
1.6.0 | |
|
String |
— |
The text shown on external link button of the content block. |
Not supported |
1.6.0 |
|
String |
— |
Color theme to use for the external link button. Set to |
Not supported |
1.6.0 |
|
Any |
|
The graphic to display to represent a 'full' rating slot (such as a full star). Used when |
Not supported |
1.2.0 |
|
Any |
|
The graphic to display to represent a 'half' rating slot (such as a half star). Used when |
Not supported |
1.2.0 |
|
String |
— |
URL for attribution image source. Displays when |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
— |
Attribution text to render in the header. Shown when |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
|
An accessibility label to describe the back button to customers who use a screen reader. |
Not supported |
1.2.0 |
|
|
Command to run when the user selects the back button. |
Not supported |
1.2.0 | |
|
String |
|
Optional color value to use as the background color for the header. |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
— |
Secondary text to render in header. |
Not supported |
1.2.0 |
|
String |
— |
Primary text to render in header. |
Not supported |
1.2.0 |
|
String |
|
Determines how to position the image within the bounding box. Used when the image is smaller than the bounding box. Options are bottom, bottom-left, bottom-right, center, left, right, top, top-left, top-right. For more details about image alignment, see the |
Not supported |
1.2.0 |
|
String |
|
Aspect ratio to use for the image bounding box. The image width is set to a standard default based on the aspect ratio. Options are square, round, standard_landscape, standard_portrait, poster_landscape, poster_portrait, and widescreen. |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
— |
A title or brief explanation of the image, displayed below the image. |
Not supported |
1.2.0 |
|
— |
Height of the image bounding box. The image is scaled to fit within this height using the |
Not supported |
1.2.0 | |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
|
Determines how to scale the image to fit within the bounding box. Options are none, fill, best-fit, best-fill, or best-fit-down. For more details about image scaling, see the |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.3.0 |
|
String |
— |
URI for the image to display. |
Not supported |
1.2.0 |
|
Any |
— |
Applies when |
Not supported |
1.2.0 |
|
Boolean |
|
When |
Not supported |
1.2.0 |
|
String |
— |
Applies when |
Not supported |
1.2.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 |
Not supported |
1.4.0 |
|
String |
|
Specifies the layout direction for the content. Set this property to either |
Not supported |
1.4.0 |
|
String |
— |
Applies when |
Not supported |
1.2.0 |
|
String |
— |
The primary text to display in the content area. The |
Not supported |
1.2.0 |
|
String |
— |
Applies when |
Not supported |
1.2.0 |
|
String |
|
The type of graphic to use for the rating. Set to |
Not supported |
1.2.0 |
|
Number |
— |
The numeric rating between 0 and 5. Used when |
Not supported |
1.2.0 |
|
String |
|
Determines whether to display a single graphical asset for the rating, or build the rating from multiple image assets. When set to |
Not supported |
1.2.0 |
|
|
The padding to use between each rating slot. Used when |
Not supported |
1.2.0 | |
|
String |
— |
Text to display next to the rating. |
Not supported |
1.2.0 |
|
String |
— |
The component ID for the |
Not supported |
1.2.0 |
|
String |
— |
The secondary text to display in the content area, after the |
Not supported |
1.2.0 |
|
Any |
— |
The graphic to display to represent the rating. Used when |
Not supported |
1.2.0 |
|
— |
The width of the bounding box for the single graphic that represents the rating. Used when |
Not supported |
1.2.0 | |
|
String |
— |
Applies when |
Not supported |
1.2.0 |
|
String |
|
Set the dark or light color theme. The selected theme controls the colors used for the component. |
Not supported |
1.2.0 |
|
String |
— |
Always set to |
Not supported |
1.2.0 |
AlexaDetail content types and layouts
AlexaDetail
includes four different layouts for displaying different types of content. The overall layout with an image on one side and text content on the other is the same across these variants.
You set the variant you want with the detailType
parameter.
Generic
The generic (generic
) layout is the default. This variant displays an image on one side of the viewport and a content section with text on the other side. You can also choose to include up to two buttons.
Movies and TV
The movies and TV variant (moviesTV
) follows the same layout as generic
and adds the following properties:
tertiaryText
/quaternaryText
– These properties define text to display below the standardsecondaryText
and are useful for information such as the show length and genre.rating*
– The rating properties let you display either a calculated star rating, or a custom rating in the form of a graphic. When included, the rating displays on the same line as thetertiaryText
. For details about how the rating properties work, seeAlexaRating
.
The following example illustrates the properties specific to moviesTV
:
- The
tertiaryText
property contains the duration of the show. - The
quaternaryText
property is set. - The
rating
properties are set to display a custom "PG" rating graphic.
Location
The location variant (location
) follows the same layout as generic
, and adds the following properties:
locationText
– Defines text to display the location. Use this to display the name or address of the location. When included, the location displays after theprimaryText
and the rating, before thesecondaryText
.rating*
– The rating properties let you display either a calculated star rating, or a custom rating in the form of a graphic. When included, the rating displays immediately after theprimaryText
. For details about how the rating properties work, seeAlexaRating
.
The following example illustrates the properties specific to location
:
- The
locationText
property contains a line of text. - The
rating
properties are configured to display a star rating set by providing a number in theratingNumber
property.
This example also illustrates how the entire button row disappears when you leave both button1Text
and button2Text
not set.
Recipe
The recipe variant (recipe
) follows the same layout as generic
and adds the following properties:
rating*
– The rating properties let you display either a calculated star rating, or a custom rating in the form of a graphic. When included, the rating displays immediately after theprimaryText
. For details about how the rating properties work, seeAlexaRating
.ingredientsText
– A heading to display before the list of ingredients.ingredientsHideDivider
– When true, hide the divider line between each ingredient in the ingredients list.ingredientListItems
– An array of items to display as a list of ingredients. Each item hasingredientsContentText
andingredientsPrimaryAction
properties.
The recipe
variant doesn't use the bodyText
property.
The following example illustrates the properties specific to recipe
:
- The
ingredientsText
,ingredientsHideDivider
, andingredientListItems
properties are all set. - The
rating
properties are configured to display a star rating set by providing a number in theratingNumber
property.
AlexaDetail example
The following example illustrates a complete document and data source that uses AlexaDetail
. This example uses the generic
variation.
Related topics
- Alexa Design System Overview
- Responsive Components and Templates
- Alexa Design Guide: Responsive Templates
Last updated: Nov 28, 2023