Paginated List (1.5.0)
(This is not the most recent version of AlexaPaginatedList
. Use the Other Versions option to see the documentation for the most recent version of AlexaPaginatedList
)
The Alexa paginated list template (AlexaPaginatedList
) displays a list of items in a series of pages. This is a full-screen template that can include the header and background. You provide a set of text-based items to display. The template includes a page counter that shows the current page and the total number of pages.
Import the alexa-layouts package
To use AlexaPaginatedList
, import the alexa-layouts package.
The latest version of the alexa-layouts
package is 1.7.0. AlexaPaginatedList
was introduced in version 1.1.0.
AlexaPaginatedList parameters
All parameters except type
are optional.
Name | Type | Default | Description | Version added |
---|---|---|---|---|
|
String |
|
Image/video alignment to apply to background image/video. |
1.1.0 |
|
Boolean |
|
When |
1.1.0 |
|
— |
Color to use as a background color. Used when neither |
1.1.0 | |
|
Boolean |
|
When |
1.1.0 |
|
String |
— |
URL for the background image source. Used when |
1.1.0 |
|
Boolean |
|
When |
1.1.0 |
|
String |
|
Image or video scaling to apply to background image or video. |
1.1.0 |
|
String |
|
Audio track to play on when playing the video. Can be |
1.1.0 |
|
Boolean |
|
When |
1.1.0 |
|
— |
The background video source. Provide a source in the same format shown for the |
1.1.0 | |
|
Array |
— |
Array of entity data to bind to this template. |
1.2.0 |
|
String |
— |
URL for attribution image source. Displays when |
1.1.0 |
|
Number |
|
The opacity of the attribution text and attribution image in the header. Set to a number between 0 and 1. |
1.3.0 |
|
Boolean |
|
When |
1.1.0 |
|
String |
— |
Attribution text to render in the header. Shown only when no |
1.1.0 |
|
Boolean |
|
When |
1.1.0 |
|
String |
— |
An accessibility label to describe the back button to customers who use a screen reader. |
1.1.0 |
|
|
Command to run when the user selects the back button. |
1.1.0 | |
|
String |
|
Optional color value to use as the background color for the Header. |
1.1.0 |
|
Boolean |
|
When |
1.1.0 |
|
String |
— |
Secondary text to render in header. |
1.1.0 |
|
String |
— |
Primary text to render in header. |
1.1.0 |
|
String |
|
Specifies the layout direction for the content. Set this property to either |
1.4.0 |
|
String |
— |
An identifier to assign to the |
1.2.0 |
|
— |
Array of list items to display in list. |
1.1.0 | |
|
— |
The action to trigger when an item is selected. |
1.1.0 | |
|
Any |
— |
An array of speech items. The template assigns each item in this array to the |
1.2.0 |
|
String |
|
Set the dark or light color theme. The selected theme controls the colors used for the template. |
1.1.0 |
|
String |
— |
Always set to |
1.1.0 |
Provide the pages to display
The AlexaPaginatedList
template expects an array of items in the listItems
property. Each item is an object with a subset of the properties defined in the AlexaImageListItem
responsive component. Not all of the properties available for an AlexaImageList
are used in an AlexaPaginatedList
.
The following table summarizes the AlexaImageListItem
properties that AlexaPaginatedList
uses. Any other properties are ignored.
Property | Type | Description |
---|---|---|
primaryText |
String | Title for full-screen item. |
secondaryText |
String | Secondary text for full-screen item. |
tertiaryText |
String | Tertiary text for full-screen item. |
imageSource |
String | URL for the image to use for this item. This overrides any image provided in the backgroundImageSource for the entire list. |
primaryAction |
Command | Command to run when the user selects the item. This overrides the primaryAction set on the the full list |
For example, you could define an array of items in a data source like this:
The following example illustrates an array of items in a data source called paginatedListData
.
{
"paginatedListData": {
"listItemsToShow": [
{
"primaryText": "First list item",
"secondaryText": "Secondary text",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/md_gruyere.png",
"providerText": "This property is ignored"
},
{
"primaryText": "Second list item",
"secondaryText": "Secondary Text",
"tertiaryText": "This one has tertiary text",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/md_gorgonzola.png"
},
{
"primaryText": "No image, use the default",
"secondaryText": "Secondary text"
},
{
"primaryText": "Fourth list item (primary text only)",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/tl_brie.png"
},
{
"primaryText": "Fifth list item",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/MollyforBT7.png"
},
{
"primaryText": "Sixth list item (make this really long text that wraps on most devices. Text longer than 2 lines truncates)",
"secondaryText": "Longer secondary text that truncates",
"imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/sm_blue.png"
}
]
}
}
Then, bind this array to the listItems
property with the expression ${paginatedListData.listItemsToShow}
.
{
"type": "AlexaPaginatedList",
"listItems": "${paginatedListData.listItemsToShow}",
"backgroundColorOverlay": "true",
"primaryAction": {
"type": "SendEvent",
"arguments": [
"ListItemSelected",
"${ordinal}"
]
}
}
Specify the action for each list item
AlexaPaginatedList
is interactive. Users can select items on the list. Set the primaryAction
property to the command you want to run when the user selects an item.
When you set primaryAction
on the AlexaPaginatedList
component, AlexaPaginatedList
passes the command to each item on the list.
To override command for an individual list item, set the primaryAction
property on the list item itself.
The following example shows how you to use the SendEvent
command to send your skill a UserEvent
request. This passes the number representing the selected item as part of the SendEvent.arguments
array.
{
"primaryAction": {
"type": "SendEvent",
"arguments": [
"ListItemSelected",
"${ordinal}"
]
}
}
AlexaPaginatedList example
In this example, selecting a list item sends your skill a UserEvent
with "ListItemSelected" and the number of the list item.
Related topics
Last updated: Nov 28, 2023