Carousels allow users to browse through a set of items to find items that may be of interest to them.
Carousels should:
A carousel with required props title
and description
. The description is used for the aria-description
of the carousel.
The carousel will automatically determine how many slides to show per page as follows:
Desktop viewports (>= 768px
) will show a number of cards per page depending on the container width:
> 1024px
will show 4 cards per page650px
to 1023px
will show 3 cards per page< 650px
will show 2 cards per page< 768px
) regardless of container width will show all cards with horizontal scrollTo view the behavior on a wider page, see the responsive example in the Cookbook.
A carousel with an optional navigational link. You must provide link
an EzLink.
Providing an optional function to onPageChange
will call that action when the user clicks a page change button in the carousel for desktop viewports, providing a method of tracking user interaction. If needed, the previous and current page numbers are available as arguments, starting at page 1.
An example of how you might use the carousel in conjunction with other components to build a compelling experience for browsing products.
To view the behavior on a wider page, see the responsive example.