Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
A Carousel is used to implement a single row of content metadata tiles in a Vega application UI screen. Carousels are typically used in home screen grids, in More Like This UIs, and Related Content rows, among other use cases.
  • Fixes to view recycling.
  • Removed layout props like getItemLayout and layoutId because the Carousel now determines the layout automatically.
  • Expanded the list of props to allow for greater customization of the Carousel.
  • Added a new callback prop to notify you whenever the current selected item on the Carousel changes.
  • The library is now app bundled rather than system bundled (see the following section for more details).

App bundled

This version of Carousel is app bundled, which requires an npm update before releases to make sure you have the latest version. App bundling gives you more control of when you bring in new Carousel changes to your app.

Property grouping

The itemStyle and animationDuration props can now be grouped with other props. Example:

Examples

This example demonstrates a basic horizontal carousel implementation with focus states and image rendering. The component uses the dataAdapter pattern to manage item retrieval and includes scale animations for a pressed and selected item.
This example shows how to configure a vertical scrolling carousel with custom selection borders. The implementation includes red border styling with yellow stroke effects and uses the anchored selection strategy to keep items locked during navigation.
This example showcases the Carousel’s ability to render different item types within a single row by alternating between two distinct layouts based on index. Items at even indices use a 200px width layout, while odd indices use a 500px width layout, demonstrating flexible content presentation.

Style

This stylesheet example defines styling constants for a carousel component that supports both horizontal and vertical scrolling orientations. There are container styles for the main carousel (full-screen with black background), item containers in two size variations (200px and 500px wide), and orientation-specific layouts with fixed dimensions (420px height for horizontal, 250px width for vertical).

Custom types

The following examples show custom types that you can use to define carousel items and props for the scrollable wrapper components.
  • ItemType: A custom data type that represents the structure of individual carousel items. Properties: The url (string) property is the image URL that is displayed in the carousel item. The url (string) property defines the items passed to the carousel, , and ScrollableProps.
  • ScrollableProps: Props interface for the scrollable carousel wrapper components. Properties: The data (ItemType[]) property is an array of item objects to be rendered in the carousel. The data (ItemType[]) property provides type safety for the component props in the Horizontal, Vertical, and Heterogeneous scrollable wrapper components. This ensures the data passed to these components matches the expected structure.

Features

Data adapter

Vega Carousel supports more customization by allowing you to provide a dataAdapter containing various callback functions. For more information, see the Carousel item data adapter callback functions section. Assuming you have an array called data containing the Carousel item information, you can implement the dataAdapter functions as shown in the following example.

Selection Strategy

The SelectionStrategy prop controls how a list scrolls and repositions its items when you navigate through them using the D-pad.

Anchored

The anchored style causes the selected item to stay locked on the initial item’s position. When scrolling, the items reposition so that the selected item remains anchored to that position. Screenshot that shows several squares aligned in a row with one square showing a black border. The image says scroll direction with arrows pointing horizontally.

Natural

The natural style causes the selected item to move in the direction of the Carousel’s orientation until it reaches the start or end of the list. Screenshot that shows a similar scroll direction graphic, but there are three rows and each row has a different square that has a black border. The image shows the progression of scroll direction in each row, as if to scroll to the right.

Pinned

The pinned style pins the selected item at a specified position during scrolling for larger sets of items. As your user approaches the beginning or end of the list, the scroll behavior transitions smoothly into the natural flow. The optional prop pinnedSelectedItemOffset allows you to define the pin location for the selected item when the SelectionStrategy is pinned. The pinnedSelectedItemOffset prop determines where the selected item stays fixed (or ‘pinned’) in the Carousel’s viewport. You can specify this position in two ways:
  • As a percentage (0-100%) of the viewport’s size:
    • For vertical Carousels: percentage of height
    • For horizontal Carousels: percentage of width
  • Using preset values:
    • start (equals 0%)
    • center (equals 50%)
    • end (equals 100%)
In horizontal mode, measurements are from the left edge, except for right-to-left languages.

Variable Scroll Speed

The Carousel component introduces a novel feature for controlling scroll speed through several AnimationDurationProps. Unlike existing components, such as Flatlist or Flashlist, this feature offers enhanced flexibility, so you can fine-tune the scrolling experience. The itemPressedDuration prop controls the animation duration when pressing on a Carousel item. The itemScrollDuration prop controls the animation duration used to scroll to each Carousel item. The containerSelectionChangeDuration prop controls the animation duration when changing the selected Carousel container.

Selection Border

The Carousel component supports displaying a border around a UI item when selected. You can style the border and choose how to draw the content and border for the selected item. You can enable the border by defining the selectionBorder prop. The default props for the selection border are shown in the following example.
Vega Carousel supports the borderStrategy prop. The prop supports two types of strategies:
  • outset - where the border is drawn outside of the original bounds of the item, so the item’s content size remains the same but the overall item size gets bigger.
  • inset - where the border is drawn within the bounds of the item over the item’s content, so while the item’s content size remains the same, part of the item’s content is cropped by the border. The overall item size remains the same.

Props

Selection border props

Animation duration props

The Carousel component provides methods for programmatic control of the navigation experience. The following methods are accessible by passing an instance of the current component to the ref prop.

Troubleshooting

Vertical scroll only works with a set height

In the case of vertical scrolling (specifically natural scrolling), you need to set containerStyle with a fixed height value.
Last modified on June 3, 2026