Pagination Dots
The Alexa pagination dots responsive component AlexaPaginationDots displays a graphical representation of the current page and the total number of pages in a pager. The component can animate as the user changes the pages. Use AlexaPaginationDots in widgets with multiple pages to provide this information in a small space.
Compatibility
AlexaPaginationDots is designed to work with the following viewport profiles:
- The following widget viewport profiles in the
alexa-viewport-profilespackage:- Widget Medium (
@hubWidgetMedium)
- Widget Medium (
- All standard viewport profiles in the
alexa-viewport-profilespackage:- 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 AlexaPaginationDots on an unsupported viewport, you might have unexpected results.
Import the alexa-layouts package
To use AlexaPaginationDots, import the alexa-layouts package.
The latest version of the alexa-layouts package is 1.7.0. AlexaPaginationDots was introduced in version 1.6.0.
AlexaPaginationDots parameters
The following table shows the parameters you can set on AlexaPaginationDots. 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 |
|---|---|---|---|---|---|
|
|
String |
|
Specifies the background style for the component. |
Medium |
1.6.0 |
|
|
Any |
— |
Array of entity data to bind to this layout. |
Medium |
1.6.0 |
|
|
String |
|
Specifies the layout direction for the component. Set this property to either |
Medium |
1.6.0 |
|
|
Number |
1 |
The total number of pages in the pager. |
Medium |
1.6.0 |
|
|
Number |
0 |
The index for the page currently-displayed page. |
Medium |
1.6.0 |
|
|
String |
"paginationDotsComponentId" |
An identifier to assign to the |
Medium |
1.6.0 |
|
|
String |
center |
Specifies the placement of the component. |
Medium |
1.6.0 |
|
|
String |
|
Set the dark or light color theme. The selected theme controls the colors used for the component. |
Medium |
1.6.0 |
|
|
String |
— |
Always set to |
Medium |
1.6.0 |
Commands
The AlexaPaginationDots component provides two commands that animate page changes. Run these commands from the onPageChanged handler of your Pager.
NextPage– Animates the pagination dots in a forward direction.PreviousPage– Animates the pagination dots in a backward direction.
The following table shows the parameters for the NextPage and PreviousPage commands.
| Property | Type | Default | Description |
|---|---|---|---|
|
|
String |
"paginationDotsComponentId" |
The identifier for the |
|
|
Number |
0 |
The index of the page that has moved into view. |
|
|
Boolean |
|
Indicates whether the page change was due to a timed, automatic scroll, or user interaction. Only applies for |
AlexaPaginationDots example
The following example shows AlexaPaginationDots displayed below a Pager component. When you change pages, the onPageChanged event handler runs the NextPage or PreviousPage commands to animate the pagination dots.
The following example shows a similar Pager with AlexaPaginationDots, displayed in a widget.
Related topics
Last updated: Dec 06, 2023